diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:24:59 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:24:59 +0200 |
commit | a1c91f4695e208d5a8f80dc37b1818169b7829ff (patch) | |
tree | 52f5134376d17c99b6c9e53133a2eb5cf171377c /file_hierarchy.cpp | |
parent | 5.16 (diff) | |
download | FreeFileSync-a1c91f4695e208d5a8f80dc37b1818169b7829ff.tar.gz FreeFileSync-a1c91f4695e208d5a8f80dc37b1818169b7829ff.tar.bz2 FreeFileSync-a1c91f4695e208d5a8f80dc37b1818169b7829ff.zip |
5.17
Diffstat (limited to 'file_hierarchy.cpp')
-rw-r--r-- | file_hierarchy.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/file_hierarchy.cpp b/file_hierarchy.cpp index 35abf251..13c73731 100644 --- a/file_hierarchy.cpp +++ b/file_hierarchy.cpp @@ -28,7 +28,7 @@ void HierarchyObject::removeEmptyRec() refSubDirs ().remove_if(isEmpty); if (emptyExisting) //notify if actual deletion happened - notifySyncCfgChanged(); //mustn't call this in ~FileSystemObject(), since parent, usually a DirMapping, is already partially destroyed and existing as a pure HierarchyObject! + 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 @@ -130,15 +130,15 @@ SyncOperation FileSystemObject::testSyncOperation(SyncDirection testSyncDir) con SyncOperation FileSystemObject::getSyncOperation() const { - return getIsolatedSyncOperation(getCategory(), selectedForSynchronization, syncDir, syncDirConflict.get() != nullptr); - //no *not* make a virtual call to testSyncOperation()! See FileMapping::testSyncOperation()! <- better not implement one in terms of the other!!! + return getIsolatedSyncOperation(getCategory(), selectedForSynchronization, getSyncDir(), syncDirConflict.get() != nullptr); + //no *not* make a virtual call to testSyncOperation()! See FilePair::testSyncOperation()! <- better not implement one in terms of the other!!! } -//SyncOperation DirMapping::testSyncOperation() const -> no recursion: we do NOT want to consider child elements when testing! +//SyncOperation DirPair::testSyncOperation() const -> no recursion: we do NOT want to consider child elements when testing! -SyncOperation DirMapping::getSyncOperation() const +SyncOperation DirPair::getSyncOperation() const { if (!syncOpUpToDate) { @@ -224,14 +224,14 @@ SyncOperation DirMapping::getSyncOperation() const inline //it's private! -SyncOperation FileMapping::applyMoveOptimization(SyncOperation op) const +SyncOperation FilePair::applyMoveOptimization(SyncOperation op) const { /* check whether we can optimize "create + delete" via "move": note: as long as we consider "create + delete" cases only, detection of renamed files, should be fine even for "binary" comparison variant! */ if (moveFileRef) - if (auto refFile = dynamic_cast<const FileMapping*>(FileSystemObject::retrieve(moveFileRef))) //we expect a "FileMapping", but only need a "FileSystemObject" + if (auto refFile = dynamic_cast<const FilePair*>(FileSystemObject::retrieve(moveFileRef))) //we expect a "FilePair", but only need a "FileSystemObject" { SyncOperation opRef = refFile->FileSystemObject::getSyncOperation(); //do *not* make a virtual call! @@ -252,13 +252,13 @@ SyncOperation FileMapping::applyMoveOptimization(SyncOperation op) const } -SyncOperation FileMapping::testSyncOperation(SyncDirection testSyncDir) const +SyncOperation FilePair::testSyncOperation(SyncDirection testSyncDir) const { return applyMoveOptimization(FileSystemObject::testSyncOperation(testSyncDir)); } -SyncOperation FileMapping::getSyncOperation() const +SyncOperation FilePair::getSyncOperation() const { return applyMoveOptimization(FileSystemObject::getSyncOperation()); } @@ -360,8 +360,8 @@ std::wstring zen::getSyncOpDescription(const FileSystemObject& fsObj) case SO_MOVE_LEFT_TARGET: case SO_MOVE_RIGHT_SOURCE: case SO_MOVE_RIGHT_TARGET: - if (const FileMapping* sourceFile = dynamic_cast<const FileMapping*>(&fsObj)) - if (const FileMapping* targetFile = dynamic_cast<const FileMapping*>(FileSystemObject::retrieve(sourceFile->getMoveRef()))) + if (const FilePair* sourceFile = dynamic_cast<const FilePair*>(&fsObj)) + if (const FilePair* targetFile = dynamic_cast<const FilePair*>(FileSystemObject::retrieve(sourceFile->getMoveRef()))) { const bool onLeft = op == SO_MOVE_LEFT_SOURCE || op == SO_MOVE_LEFT_TARGET; const bool isSource = op == SO_MOVE_LEFT_SOURCE || op == SO_MOVE_RIGHT_SOURCE; |