Clean up sync termination and restart procedure after file blacklisting done
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Tue, 20 Dec 2022 17:29:24 +0000 (18:29 +0100)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Tue, 24 Jan 2023 16:00:15 +0000 (17:00 +0100)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/folder.cpp

index 755f4c219f2175414170974ec3f88a8e150b5168..60750e4d1f05efb1f3ab4d0fab5ffed00aaca246 100644 (file)
@@ -1372,9 +1372,6 @@ void Folder::removeLocalE2eFiles()
         return;
     }
 
-    const auto currentSyncPaused = syncPaused();
-    setSyncPaused(true);
-
     qCInfo(lcFolder) << "About to blacklist: " << e2eFoldersToBlacklist;
 
     bool ok = false;
@@ -1386,13 +1383,16 @@ void Folder::removeLocalE2eFiles()
     _journal.setSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, expandedBlacklist);
     _journal.setSelectiveSyncList(SyncJournalDb::SelectiveSyncE2eFoldersToRemoveFromBlacklist, e2eFoldersToBlacklist);
 
-    setSyncPaused(currentSyncPaused);
+    if(isBusy()) {
+        slotTerminateSync();
+    }
 
     for (const auto &path : qAsConst(e2eFoldersToBlacklist)) {
         _journal.schedulePathForRemoteDiscovery(path);
+        schedulePathForLocalDiscovery(path);
     }
 
-    scheduleThisFolderSoon();
+    slotScheduleThisFolder();
 }
 
 QString Folder::fileFromLocalPath(const QString &localPath) const