SyncEngine: cleanup setting isDirectory
authorOlivier Goffart <ogoffart@woboq.com>
Tue, 24 May 2016 13:17:35 +0000 (15:17 +0200)
committerOlivier Goffart <ogoffart@woboq.com>
Wed, 25 May 2016 14:27:40 +0000 (16:27 +0200)
src/libsync/syncengine.cpp

index f3e908461aef9e0948d0725c6530d9b951c23070..36fefc0365f01370a520c1234d59b0937504f415 100644 (file)
@@ -548,13 +548,12 @@ int SyncEngine::treewalkFile( TREE_WALK_FILE *file, bool remote )
         bool directoryEtagUpdate = isDirectory && file->should_update_metadata;
         bool localMetadataUpdate = !remote && file->should_update_metadata;
         if (!directoryEtagUpdate) {
+            item->_isDirectory = isDirectory;
             if (localMetadataUpdate) {
                 // Hack, we want a local metadata update to happen, but only if the
                 // remote tree doesn't ask us to do some kind of propagation.
-                item->_isDirectory = isDirectory;
                 _syncItemMap.insert(key, item);
             }
-            item->_isDirectory = isDirectory;
             emit syncItemDiscovered(*item);
             return re;
         }
@@ -581,7 +580,7 @@ int SyncEngine::treewalkFile( TREE_WALK_FILE *file, bool remote )
             // An upload of an existing file means that the file was left unchanged on the server
             // This counts as a NONE for detecting if all the files on the server were changed
             _hasNoneFiles = true;
-        } else if (!item->_isDirectory) {
+        } else if (!isDirectory) {
             if (std::difftime(file->modtime, file->other.modtime) < 0) {
                 // We are going back on time
                 _backInTimeFiles++;