[Pkg-owncloud-commits] [owncloud-client] 241/498: TrayMenu: Ensure it updates when accounts are added or removed.

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Aug 11 14:48:54 UTC 2015


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 9ad79cfc527914895e3afbc1246dcc9e17133b86
Author: Christian Kamm <kamm at incasoftware.de>
Date:   Fri Jul 3 11:13:19 2015 +0200

    TrayMenu: Ensure it updates when accounts are added or removed.
---
 src/gui/accountmanager.cpp | 2 +-
 src/gui/owncloudgui.cpp    | 5 +++++
 src/gui/owncloudgui.h      | 3 +--
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/gui/accountmanager.cpp b/src/gui/accountmanager.cpp
index d5a47d7..71e65d3 100644
--- a/src/gui/accountmanager.cpp
+++ b/src/gui/accountmanager.cpp
@@ -216,7 +216,7 @@ void AccountManager::deleteAccount(AccountState* account)
     auto settings = Account::settingsWithGroup(QLatin1String(accountsC));
     settings->remove(account->account()->id());
 
-    accountRemoved(account);
+    emit accountRemoved(account);
 }
 
 
diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp
index 027e003..f7bf91c 100644
--- a/src/gui/owncloudgui.cpp
+++ b/src/gui/owncloudgui.cpp
@@ -89,6 +89,11 @@ ownCloudGui::ownCloudGui(Application *parent) :
     connect( folderMan, SIGNAL(folderSyncStateChange(Folder*)),
              this,SLOT(slotSyncStateChange(Folder*)));
 
+    connect( AccountManager::instance(), SIGNAL(accountAdded(AccountState*)),
+             SLOT(setupContextMenu()));
+    connect( AccountManager::instance(), SIGNAL(accountRemoved(AccountState*)),
+             SLOT(setupContextMenu()));
+
     connect( Logger::instance(), SIGNAL(guiLog(QString,QString)),
              SLOT(slotShowTrayMessage(QString,QString)));
     connect( Logger::instance(), SIGNAL(optionalGuiLog(QString,QString)),
diff --git a/src/gui/owncloudgui.h b/src/gui/owncloudgui.h
index 72b3657..0408f94 100644
--- a/src/gui/owncloudgui.h
+++ b/src/gui/owncloudgui.h
@@ -43,8 +43,6 @@ class ownCloudGui : public QObject
 public:
     explicit ownCloudGui(Application *parent = 0);
 
-    void setupContextMenu();
-
     bool checkAccountExists(bool openSettings);
 
     static void raiseDialog(QWidget *raiseWidget);
@@ -54,6 +52,7 @@ signals:
     void setupProxy();
 
 public slots:
+    void setupContextMenu();
     void slotComputeOverallSyncStatus();
     void slotShowTrayMessage(const QString &title, const QString &msg);
     void slotShowOptionalTrayMessage(const QString &title, const QString &msg);

-- 
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