summaryrefslogtreecommitdiff
path: root/synchronization.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:11:33 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:11:33 +0200
commit6fcfe73ca751f068978ce201094b17cf2dfe4d20 (patch)
treee7d85e8f9057430b480cd0e2f5ccb43c9d2ef8f8 /synchronization.cpp
parent3.15 (diff)
downloadFreeFileSync-6fcfe73ca751f068978ce201094b17cf2dfe4d20.tar.gz
FreeFileSync-6fcfe73ca751f068978ce201094b17cf2dfe4d20.tar.bz2
FreeFileSync-6fcfe73ca751f068978ce201094b17cf2dfe4d20.zip
3.16
Diffstat (limited to 'synchronization.cpp')
-rw-r--r--synchronization.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/synchronization.cpp b/synchronization.cpp
index f98e15f6..d131b567 100644
--- a/synchronization.cpp
+++ b/synchronization.cpp
@@ -699,7 +699,7 @@ struct CallbackRemoveDirImpl : public CallbackRemoveDir
{
CallbackRemoveDirImpl(StatusHandler& handler) : statusHandler_(handler) {}
- virtual void requestUiRefresh(const Zstring& currentObject)
+ virtual void notifyDeletion(const Zstring& currentObject)
{
statusHandler_.requestUiRefresh(); //exceptions may be thrown here!
}
@@ -943,8 +943,8 @@ void SynchronizeFolderPair::execute(HierarchyObject& hierObj)
//synchronize files:
for (HierarchyObject::SubFileMapping::iterator i = hierObj.useSubFiles().begin(); i != hierObj.useSubFiles().end(); ++i)
{
- if (( reduceDiskSpace && diskSpaceIsReduced(*i)) ||
- (!reduceDiskSpace && !diskSpaceIsReduced(*i)))
+ const bool letsDoThis = reduceDiskSpace == diskSpaceIsReduced(*i);
+ if (letsDoThis)
tryReportingError(statusUpdater_, boost::bind(&SynchronizeFolderPair::synchronizeFile, this, boost::ref(*i)));
}
@@ -958,14 +958,17 @@ void SynchronizeFolderPair::execute(HierarchyObject& hierObj)
{
const SyncOperation syncOp = i->getSyncOperation();
- if (( reduceDiskSpace && diskSpaceIsReduced(*i)) || //ensure folder creation happens in second pass, to enable time adaption below
- (!reduceDiskSpace && !diskSpaceIsReduced(*i))) //
+ //ensure folder creation happens in second pass, to enable time adaption below
+ const bool letsDoThis = reduceDiskSpace == diskSpaceIsReduced(*i);
+
+ if (letsDoThis)
tryReportingError(statusUpdater_, boost::bind(&SynchronizeFolderPair::synchronizeFolder, this, boost::ref(*i)));
//recursive synchronization:
execute<reduceDiskSpace>(*i);
//adapt folder modification dates: apply AFTER all subobjects have been synced to preserve folder modification date!
+ if (letsDoThis)
try
{
switch (syncOp)
@@ -1905,7 +1908,7 @@ void SynchronizeFolderPair::copyFileUpdating(const Zstring& source, const Zstrin
const Zstring targetDir = target.BeforeLast(common::FILE_NAME_SEPARATOR);
const Zstring templateDir = source.BeforeLast(common::FILE_NAME_SEPARATOR);
- if (!targetDir.empty() && !ffs3::dirExists(targetDir))
+ if (!targetDir.empty())
{
ffs3::createDirectory(targetDir, templateDir, copyFilePermissions_); //throw (FileError)
/*symbolic link handling:
bgstack15