Uses configuraion to determine if it should show empty folder popup.
authorCamila San <hello@camila.codes>
Fri, 12 Apr 2019 10:11:43 +0000 (12:11 +0200)
committerCamila San <hello@camila.codes>
Fri, 12 Apr 2019 14:22:07 +0000 (16:22 +0200)
Configuration default value is set to false because  users are getting
the popup message too often.

Signed-off-by: Camila San <hello@camila.codes>
src/libsync/configfile.cpp
src/libsync/syncengine.cpp

index 5fb2ef10f38dd68a273b465db3537102dfd29788..a2881d4a8164441ae26b9aad7a51c8d6815c93d3 100644 (file)
@@ -750,7 +750,7 @@ void ConfigFile::setMoveToTrash(bool isChecked)
 bool ConfigFile::promptDeleteFiles() const
 {
     QSettings settings(configFile(), QSettings::IniFormat);
-    return settings.value(QLatin1String(promptDeleteC), true).toBool();
+    return settings.value(QLatin1String(promptDeleteC), false).toBool();
 }
 
 void ConfigFile::setPromptDeleteFiles(bool promptDeleteFiles)
index a8077ed03028bfbc1dd6521bae9990c1c5db19e1..d9c240a93141097942553c22429e0c224d2ca139 100644 (file)
@@ -26,6 +26,8 @@
 #include "propagateremotedelete.h"
 #include "propagatedownload.h"
 #include "common/asserts.h"
+#include "configfile.h"
+
 
 #ifdef Q_OS_WIN
 #include <windows.h>
@@ -1035,7 +1037,8 @@ void SyncEngine::slotDiscoveryJobFinished(int discoveryResult)
         }
     }
 
-    if (!_hasNoneFiles && _hasRemoveFile) {
+    ConfigFile cfgFile;
+    if (!_hasNoneFiles && _hasRemoveFile && cfgFile.promptDeleteFiles()) {
         qCInfo(lcEngine) << "All the files are going to be changed, asking the user";
         bool cancel = false;
         emit aboutToRemoveAllFiles(syncItems.first()->_direction, &cancel);