Extract syncIsPaused initialisation into new updater slot

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-03-27 18:09:33 +08:00 committed by Camila Ayres
parent 92f6de9ca9
commit d497e265df
2 changed files with 13 additions and 8 deletions

View File

@ -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);

View File

@ -152,6 +152,7 @@ public slots:
void presentShareViewInTray(const QString &localPath);
private slots:
void slotUpdateSyncPausedState();
void slotUnpauseAllFolders();
void slotPauseAllFolders();