[Pkg-owncloud-commits] [owncloud-client] 58/121: Tray: Add minimal mode as workaround and testing tool #4985 #4990

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Jul 28 15:31:58 UTC 2016


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 440a8048360dd9169d6398faeaab6dc2fa31b37d
Author: Christian Kamm <mail at ckamm.de>
Date:   Thu Jun 23 10:22:43 2016 +0200

    Tray: Add minimal mode as workaround and testing tool #4985 #4990
---
 src/gui/owncloudgui.cpp | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp
index 63e4e32..12f6838 100644
--- a/src/gui/owncloudgui.cpp
+++ b/src/gui/owncloudgui.cpp
@@ -399,8 +399,26 @@ void ownCloudGui::addAccountContextMenu(AccountStatePtr accountState, QMenu *men
 
 }
 
+static bool minimalTrayMenu()
+{
+    static QByteArray var = qgetenv("OWNCLOUD_MINIMAL_TRAY_MENU");
+    return !var.isEmpty();
+}
+
 void ownCloudGui::setupContextMenu()
 {
+    // The tray menu is surprisingly problematic. Being able to switch to
+    // a minimal version of it is a useful workaround and testing tool.
+    if (minimalTrayMenu()) {
+        if (!_contextMenu) {
+            _contextMenu.reset(new QMenu());
+            _recentActionsMenu = new QMenu(tr("Recent Changes"), _contextMenu.data());
+            _tray->setContextMenu(_contextMenu.data());
+            _contextMenu->addAction(_actionQuit);
+        }
+        return;
+    }
+
     auto accountList = AccountManager::instance()->accounts();
 
     bool isConfigured = (!accountList.isEmpty());

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list