diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:26:50 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:26:50 +0200 |
commit | 669df123648aaa6aeccc70206b5417bc48b4e9ae (patch) | |
tree | 463c107a8d6405020bb304f7a7253e6b64afeee0 /file_hierarchy.cpp | |
parent | 5.18 (diff) | |
download | FreeFileSync-669df123648aaa6aeccc70206b5417bc48b4e9ae.tar.gz FreeFileSync-669df123648aaa6aeccc70206b5417bc48b4e9ae.tar.bz2 FreeFileSync-669df123648aaa6aeccc70206b5417bc48b4e9ae.zip |
5.19
Diffstat (limited to 'file_hierarchy.cpp')
-rw-r--r-- | file_hierarchy.cpp | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/file_hierarchy.cpp b/file_hierarchy.cpp index 13c73731..c20b971e 100644 --- a/file_hierarchy.cpp +++ b/file_hierarchy.cpp @@ -30,9 +30,8 @@ void HierarchyObject::removeEmptyRec() if (emptyExisting) //notify if actual deletion happened notifySyncCfgChanged(); //mustn't call this in ~FileSystemObject(), since parent, usually a DirPair, is already partially destroyed and existing as a pure HierarchyObject! - // for (auto& subDir : refSubDirs()) - // subDir.removeEmptyRec(); //recurse - std::for_each(refSubDirs().begin(), refSubDirs().end(), [&](HierarchyObject& hierObj) { hierObj.removeEmptyRec(); }); + for (auto& subDir : refSubDirs()) + subDir.removeEmptyRec(); //recurse } namespace @@ -42,7 +41,7 @@ SyncOperation getIsolatedSyncOperation(CompareFilesResult cmpResult, SyncDirection syncDir, bool hasDirConflict) //perf: std::wstring was wasteful here { - assert(!hasDirConflict || syncDir == SYNC_DIR_NONE); + assert(!hasDirConflict || syncDir == SyncDirection::NONE); if (!selectedForSynchronization) return cmpResult == FILE_EQUAL ? @@ -54,11 +53,11 @@ SyncOperation getIsolatedSyncOperation(CompareFilesResult cmpResult, case FILE_LEFT_SIDE_ONLY: switch (syncDir) { - case SYNC_DIR_LEFT: + case SyncDirection::LEFT: return SO_DELETE_LEFT; //delete files on left - case SYNC_DIR_RIGHT: + case SyncDirection::RIGHT: return SO_CREATE_NEW_RIGHT; //copy files to right - case SYNC_DIR_NONE: + case SyncDirection::NONE: return hasDirConflict ? SO_UNRESOLVED_CONFLICT : SO_DO_NOTHING; } break; @@ -66,11 +65,11 @@ SyncOperation getIsolatedSyncOperation(CompareFilesResult cmpResult, case FILE_RIGHT_SIDE_ONLY: switch (syncDir) { - case SYNC_DIR_LEFT: + case SyncDirection::LEFT: return SO_CREATE_NEW_LEFT; //copy files to left - case SYNC_DIR_RIGHT: + case SyncDirection::RIGHT: return SO_DELETE_RIGHT; //delete files on right - case SYNC_DIR_NONE: + case SyncDirection::NONE: return hasDirConflict ? SO_UNRESOLVED_CONFLICT : SO_DO_NOTHING; } break; @@ -81,11 +80,11 @@ SyncOperation getIsolatedSyncOperation(CompareFilesResult cmpResult, case FILE_CONFLICT: switch (syncDir) { - case SYNC_DIR_LEFT: + case SyncDirection::LEFT: return SO_OVERWRITE_LEFT; //copy from right to left - case SYNC_DIR_RIGHT: + case SyncDirection::RIGHT: return SO_OVERWRITE_RIGHT; //copy from left to right - case SYNC_DIR_NONE: + case SyncDirection::NONE: return hasDirConflict ? SO_UNRESOLVED_CONFLICT : SO_DO_NOTHING; } break; @@ -93,17 +92,17 @@ SyncOperation getIsolatedSyncOperation(CompareFilesResult cmpResult, case FILE_DIFFERENT_METADATA: switch (syncDir) { - case SYNC_DIR_LEFT: + case SyncDirection::LEFT: return SO_COPY_METADATA_TO_LEFT; - case SYNC_DIR_RIGHT: + case SyncDirection::RIGHT: return SO_COPY_METADATA_TO_RIGHT; - case SYNC_DIR_NONE: + case SyncDirection::NONE: return hasDirConflict ? SO_UNRESOLVED_CONFLICT : SO_DO_NOTHING; } break; case FILE_EQUAL: - assert(syncDir == SYNC_DIR_NONE); + assert(syncDir == SyncDirection::NONE); return SO_EQUAL; } |