Skip to content

Commit 0aeea28

Browse files
committed
Don't display resume sync if no account is configured
Issue: #10939
1 parent 45309b8 commit 0aeea28

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
@@ -595,7 +595,6 @@ void ownCloudGui::updateContextMenu()
595595
bool isConfigured = (!accountList.isEmpty());
596596
bool atLeastOneConnected = false;
597597
bool atLeastOnePaused = false;
598-
bool atLeastOneNotPaused = false;
599598
for (const auto &a : accountList) {
600599
if (a->isConnected()) {
601600
atLeastOneConnected = true;
@@ -605,25 +604,24 @@ void ownCloudGui::updateContextMenu()
605604
for (auto *f : FolderMan::instance()->folders()) {
606605
if (f->syncPaused()) {
607606
atLeastOnePaused = true;
608-
} else {
609-
atLeastOneNotPaused = true;
610607
}
611608
}
612609

613610
_contextMenu->addAction(Theme::instance()->applicationIcon(), tr("Show %1").arg(Theme::instance()->appNameGUI()), this, &ownCloudGui::slotShowSettings);
614611
_contextMenu->addSeparator();
615-
if (atLeastOnePaused) {
616-
_contextMenu->addAction(
617-
tr("Resume synchronization"), this, [this] { setPauseOnAllFoldersHelper(AccountManager::instance()->accounts().values(), false); });
618-
} else {
619-
_contextMenu->addAction(
620-
tr("Stop synchronization"), this, [this] { setPauseOnAllFoldersHelper(AccountManager::instance()->accounts().values(), true); });
621-
}
622-
_contextMenu->addSeparator();
623612

624613
if (accountList.isEmpty()) {
625614
_contextMenu->addAction(tr("Create a new account"), this, &ownCloudGui::runNewAccountWizard);
626615
} else {
616+
if (atLeastOnePaused) {
617+
_contextMenu->addAction(
618+
tr("Resume synchronization"), this, [this] { setPauseOnAllFoldersHelper(AccountManager::instance()->accounts().values(), false); });
619+
} else {
620+
_contextMenu->addAction(
621+
tr("Stop synchronization"), this, [this] { setPauseOnAllFoldersHelper(AccountManager::instance()->accounts().values(), true); });
622+
}
623+
_contextMenu->addSeparator();
624+
627625
// submenus for accounts
628626
for (const auto &account : accountList) {
629627
QMenu *accountMenu = new QMenu(account->account()->displayName(), _contextMenu.data());

0 commit comments

Comments
 (0)