Skip to content

Commit c5bde75

Browse files
committed
Don't display resume sync if no account is configured
Issue: #10939
1 parent 32df188 commit c5bde75

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

changelog/unreleased/10939

+2
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ Change: Modernize systray menu
33
We had a closer look on the system tray and cleaned it up.
44

55
https://github.com/owncloud/client/issues/10939
6+
https://github.com/owncloud/client/pull/10949
7+
https://github.com/owncloud/client/pull/10999

src/gui/owncloudgui.cpp

+9-11
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,6 @@ void ownCloudGui::updateContextMenu()
599599
bool isConfigured = (!accountList.isEmpty());
600600
bool atLeastOneConnected = false;
601601
bool atLeastOnePaused = false;
602-
bool atLeastOneNotPaused = false;
603602
for (const auto &a : accountList) {
604603
if (a->isConnected()) {
605604
atLeastOneConnected = true;
@@ -609,25 +608,24 @@ void ownCloudGui::updateContextMenu()
609608
for (auto *f : FolderMan::instance()->folders()) {
610609
if (f->syncPaused()) {
611610
atLeastOnePaused = true;
612-
} else {
613-
atLeastOneNotPaused = true;
614611
}
615612
}
616613

617614
_contextMenu->addAction(Theme::instance()->applicationIcon(), tr("Show %1").arg(Theme::instance()->appNameGUI()), this, &ownCloudGui::slotShowSettings);
618615
_contextMenu->addSeparator();
619-
if (atLeastOnePaused) {
620-
_contextMenu->addAction(
621-
tr("Resume synchronization"), this, [this] { setPauseOnAllFoldersHelper(AccountManager::instance()->accounts().values(), false); });
622-
} else {
623-
_contextMenu->addAction(
624-
tr("Stop synchronization"), this, [this] { setPauseOnAllFoldersHelper(AccountManager::instance()->accounts().values(), true); });
625-
}
626-
_contextMenu->addSeparator();
627616

628617
if (accountList.isEmpty()) {
629618
_contextMenu->addAction(tr("Create a new account"), this, &ownCloudGui::runNewAccountWizard);
630619
} else {
620+
if (atLeastOnePaused) {
621+
_contextMenu->addAction(
622+
tr("Resume synchronization"), this, [this] { setPauseOnAllFoldersHelper(AccountManager::instance()->accounts().values(), false); });
623+
} else {
624+
_contextMenu->addAction(
625+
tr("Stop synchronization"), this, [this] { setPauseOnAllFoldersHelper(AccountManager::instance()->accounts().values(), true); });
626+
}
627+
_contextMenu->addSeparator();
628+
631629
// submenus for accounts
632630
for (const auto &account : accountList) {
633631
QMenu *accountMenu = new QMenu(account->account()->displayName(), _contextMenu.data());

0 commit comments

Comments
 (0)