From 87361f0cb30eab1c22bb3b44f51ba133995bd252 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Wed, 27 Mar 2024 19:24:54 +0800 Subject: [PATCH] Make sure to emit relevant signals and set sync is paused to true if relevant Signed-off-by: Claudio Cambra --- src/gui/systray.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui/systray.cpp b/src/gui/systray.cpp index e7b0f95d25934..13823bd09a4e0 100644 --- a/src/gui/systray.cpp +++ b/src/gui/systray.cpp @@ -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()