Alter sync engine to check new setting before displaying prompt
authorJames Botting <james@bottswanamedia.info>
Sun, 24 Jan 2016 18:45:29 +0000 (18:45 +0000)
committerJames Botting <james@bottswanamedia.info>
Sun, 24 Jan 2016 18:45:29 +0000 (18:45 +0000)
src/libsync/syncengine.cpp

index cf99c63657cd197ab32c4cfb58039f2ff9bc7ea4..4a7c73805bb91ca85385d20234fccf4b512287b9 100644 (file)
@@ -23,6 +23,7 @@
 #include "syncfilestatus.h"
 #include "csync_private.h"
 #include "filesystem.h"
+#include "configfile.h"
 
 #ifdef Q_OS_WIN
 #include <windows.h>
@@ -824,7 +825,9 @@ void SyncEngine::slotDiscoveryJobFinished(int discoveryResult)
     emit transmissionProgress(*_progressInfo);
     _progressInfo->start();
 
-    if (!_hasNoneFiles && _hasRemoveFile) {
+    // Check the config file before displaying prompt in case it is disabled.
+    ConfigFile cfgFile;
+    if (!_hasNoneFiles && _hasRemoveFile && cfgFile.promptDeleteFiles()) {
         qDebug() << Q_FUNC_INFO << "All the files are going to be changed, asking the user";
         bool cancel = false;
         emit aboutToRemoveAllFiles(_syncedItems.first()->_direction, &cancel);