Make sure to emit relevant signals and set sync is paused to true if relevant
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 27 Mar 2024 11:24:54 +0000 (19:24 +0800)
committerCamila Ayres <hello@camilasan.com>
Tue, 23 Apr 2024 18:18:18 +0000 (20:18 +0200)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/systray.cpp

index e7b0f95d2593488c6da2eb480223d8265302aabd..13823bd09a4e046c0f0d8707642fcb83b76f05e4 100644 (file)
@@ -436,12 +436,17 @@ void Systray::slotCurrentUserChanged()
 void Systray::slotUpdateSyncPausedState()
 {
     const auto folderMap = FolderMan::instance()->map();
-    for (const auto *folder : folderMap) {
+    for (const auto folder : folderMap) {
+        connect(folder, &Folder::syncPausedChanged, this, &Systray::slotUpdateSyncPausedState, Qt::UniqueConnection);
         if (!folder->syncPaused()) {
             _syncIsPaused = false;
-            break;
+            emit syncIsPausedChanged();
+            return;
         }
     }
+
+    _syncIsPaused = true;
+    emit syncIsPausedChanged();
 }
 
 void Systray::slotUnpauseAllFolders()