From 9a11bef263ee9eced4e2d63773f7db18168887b5 Mon Sep 17 00:00:00 2001 From: Sergey Zolotarev Date: Thu, 24 Oct 2019 02:50:58 +0600 Subject: [PATCH] Fix duplicate items in Apps menu (a bug introduced in #1477) Signed-off-by: Sergey Zolotarev --- src/gui/owncloudgui.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp index 28b57d295..d3828aed6 100644 --- a/src/gui/owncloudgui.cpp +++ b/src/gui/owncloudgui.cpp @@ -827,6 +827,10 @@ void ownCloudGui::fetchNavigationApps(AccountStatePtr account){ void ownCloudGui::buildNavigationAppsMenu(AccountStatePtr account, QMenu *accountMenu){ auto navLinks = _navApps.value(account); + + _navLinksMenu->clear(); + _navLinksMenu->setEnabled(navLinks.size() > 0); + if(navLinks.size() > 0){ // when there is only one account add the nav links above the settings QAction *actionBefore = _actionSettings; @@ -853,7 +857,6 @@ void ownCloudGui::buildNavigationAppsMenu(AccountStatePtr account, QMenu *accoun connect(action, &QAction::triggered, this, [href] { QDesktopServices::openUrl(href); }); _navLinksMenu->addAction(action); } - _navLinksMenu->setEnabled(true); } }