]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Do not always re-notify user on existing folder now big if this folder already black...
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Mon, 24 Jul 2023 09:05:44 +0000 (17:05 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Fri, 4 Aug 2023 09:44:22 +0000 (17:44 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/folder.cpp

index 3c0e5fd6e42d1dc32fd5ef18a8bf3d9bbea93379..1453cfbfacec75bc2c450b270f182a0d2e14423b 100644 (file)
@@ -1264,15 +1264,24 @@ void Folder::slotExistingFolderNowBig(const QString &folderPath)
     bool ok2 = false;
     auto blacklist = journal->getSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, &ok1);
     auto whitelist = journal->getSelectiveSyncList(SyncJournalDb::SelectiveSyncWhiteList, &ok2);
-    if (ok1 && ok2 && !blacklist.contains(trailSlashFolderPath) && !whitelist.contains(trailSlashFolderPath)) {
+
+
+    const auto inDecidedLists = blacklist.contains(trailSlashFolderPath) || whitelist.contains(trailSlashFolderPath);
+    if (inDecidedLists) {
+        return;
+    }
+
+    auto relevantList = stopSyncing ? blacklist : whitelist;
+    const auto relevantListType = stopSyncing ? SyncJournalDb::SelectiveSyncBlackList : SyncJournalDb::SelectiveSyncWhiteList;
+
+    if (ok1 && ok2 && !inDecidedLists) {
+        relevantList.append(trailSlashFolderPath);
+        journal->setSelectiveSyncList(relevantListType, relevantList);
+
         if (stopSyncing) {
-            blacklist.append(trailSlashFolderPath);
-            journal->setSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, blacklist);
+            // Abort current down sync and start again
             slotTerminateSync();
             scheduleThisFolderSoon();
-        } else {
-            whitelist.append(trailSlashFolderPath);
-            journal->setSelectiveSyncList(SyncJournalDb::SelectiveSyncWhiteList, whitelist);
         }
     }