Skip to content

Commit

Permalink
Extract syncIsPaused initialisation into new updater slot
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Mar 27, 2024
1 parent 709deb7 commit 86ecc74
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/gui/systray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/gui/systray.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ public slots:
void presentShareViewInTray(const QString &localPath);

private slots:
void slotUpdateSyncPausedState();
void slotUnpauseAllFolders();
void slotPauseAllFolders();

Expand Down

0 comments on commit 86ecc74

Please sign in to comment.