From 9f559c8e003fefd6cb43c64748993ed7030e30b8 Mon Sep 17 00:00:00 2001 From: Camila San Date: Sun, 28 Jan 2018 20:04:08 +0100 Subject: [PATCH] Retrieves list of apps and displays it if 'show apps' checkbox is checked in the settings. Signed-off-by: Camila San --- src/gui/owncloudgui.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp index 67726e4dd..f0f2034a4 100644 --- a/src/gui/owncloudgui.cpp +++ b/src/gui/owncloudgui.cpp @@ -650,7 +650,8 @@ void ownCloudGui::updateContextMenu() if(_cfg.showExternalSites()) fetchExternalSites(); - fetchApps(); + if(_cfg.showApps()) + fetchApps(); if (_qdbusmenuWorkaround) { _tray->show(); @@ -815,11 +816,15 @@ void ownCloudGui::fetchApps(){ void ownCloudGui::setupAppsMenu(QAction *actionBefore, QAction *actionTitle, QMenu *menu, QJsonArray apps){ menu->insertSeparator(actionBefore); menu->insertAction(actionBefore, actionTitle); + foreach (const QJsonValue &value, apps) { + // TO DO: list all apps in the menu or just a few? QString app = value.toString(); - QAction *action = new QAction(app, this); - connect(action, &QAction::triggered, this, [] { QDesktopServices::openUrl(QUrl(Theme::instance()->helpUrl())); }); - menu->insertAction(actionBefore, action); + if(app == "calendar"){ + QAction *action = new QAction("Calendar", this); + connect(action, &QAction::triggered, this, [] { QDesktopServices::openUrl(QUrl()); }); + menu->insertAction(actionBefore, action); + } } }