@@ -595,7 +595,6 @@ void ownCloudGui::updateContextMenu()
595
595
bool isConfigured = (!accountList.isEmpty ());
596
596
bool atLeastOneConnected = false ;
597
597
bool atLeastOnePaused = false ;
598
- bool atLeastOneNotPaused = false ;
599
598
for (const auto &a : accountList) {
600
599
if (a->isConnected ()) {
601
600
atLeastOneConnected = true ;
@@ -605,25 +604,24 @@ void ownCloudGui::updateContextMenu()
605
604
for (auto *f : FolderMan::instance ()->folders ()) {
606
605
if (f->syncPaused ()) {
607
606
atLeastOnePaused = true ;
608
- } else {
609
- atLeastOneNotPaused = true ;
610
607
}
611
608
}
612
609
613
610
_contextMenu->addAction (Theme::instance ()->applicationIcon (), tr (" Show %1" ).arg (Theme::instance ()->appNameGUI ()), this , &ownCloudGui::slotShowSettings);
614
611
_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 ();
623
612
624
613
if (accountList.isEmpty ()) {
625
614
_contextMenu->addAction (tr (" Create a new account" ), this , &ownCloudGui::runNewAccountWizard);
626
615
} 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
+
627
625
// submenus for accounts
628
626
for (const auto &account : accountList) {
629
627
QMenu *accountMenu = new QMenu (account->account ()->displayName (), _contextMenu.data ());
0 commit comments