From: Claudio Cambra Date: Wed, 27 Mar 2024 10:09:33 +0000 (+0800) Subject: Extract syncIsPaused initialisation into new updater slot X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~7^2~37 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=32ce3772c74dd1ad415e9ae18186e7ca0de92f56;p=nextcloud-desktop.git Extract syncIsPaused initialisation into new updater slot Signed-off-by: Claudio Cambra --- diff --git a/src/gui/systray.cpp b/src/gui/systray.cpp index fb8451aa4..e7b0f95d2 100644 --- a/src/gui/systray.cpp +++ b/src/gui/systray.cpp @@ -127,14 +127,7 @@ void Systray::create() } hideWindow(); emit activated(QSystemTrayIcon::ActivationReason::Unknown); - - const auto folderMap = FolderMan::instance()->map(); - for (const auto *folder : folderMap) { - if (!folder->syncPaused()) { - _syncIsPaused = false; - break; - } - } + slotUpdateSyncPausedState(); } void Systray::showWindow(WindowPosition position) @@ -440,6 +433,17 @@ void Systray::slotCurrentUserChanged() UserAppsModel::instance()->buildAppList(); } +void Systray::slotUpdateSyncPausedState() +{ + const auto folderMap = FolderMan::instance()->map(); + for (const auto *folder : folderMap) { + if (!folder->syncPaused()) { + _syncIsPaused = false; + break; + } + } +} + void Systray::slotUnpauseAllFolders() { setPauseOnAllFoldersHelper(false); diff --git a/src/gui/systray.h b/src/gui/systray.h index 5a4505808..058c9daf2 100644 --- a/src/gui/systray.h +++ b/src/gui/systray.h @@ -152,6 +152,7 @@ public slots: void presentShareViewInTray(const QString &localPath); private slots: + void slotUpdateSyncPausedState(); void slotUnpauseAllFolders(); void slotPauseAllFolders();