[Pkg-owncloud-commits] [owncloud-client] 03/26: Move checkAccountExists out of gui class.

Sandro Knauß hefee-guest at moszumanska.debian.org
Mon Dec 9 00:01:56 UTC 2013


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 2f708c0877defdac6a42942873a166620543d970
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Fri Nov 29 16:12:58 2013 +0100

    Move checkAccountExists out of gui class.
---
 src/mirall/application.cpp | 9 +++++----
 src/mirall/owncloudgui.cpp | 7 ++-----
 src/mirall/owncloudgui.h   | 1 +
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/mirall/application.cpp b/src/mirall/application.cpp
index 07b07a6..c1435ca 100644
--- a/src/mirall/application.cpp
+++ b/src/mirall/application.cpp
@@ -204,8 +204,9 @@ void Application::slotStartUpdateDetector()
 
 void Application::slotCheckConnection()
 {
-    if( _gui->checkAccountExists(false) ) {
-        Account *account = AccountManager::instance()->account();
+    Account *account = AccountManager::instance()->account();
+
+    if( account ) {
         AbstractCredentials* credentials(account->credentials());
 
         if (! credentials->ready()) {
@@ -216,8 +217,8 @@ void Application::slotCheckConnection()
             runValidator();
         }
     } else {
-        // the call to checkConfigExists opens the setup wizard
-        // if the config does not exist. Nothing to do here.
+        // let gui open the setup wizard
+        _gui->slotOpenSettingsDialog( true );
     }
 }
 
diff --git a/src/mirall/owncloudgui.cpp b/src/mirall/owncloudgui.cpp
index 424fb84..770ed38 100644
--- a/src/mirall/owncloudgui.cpp
+++ b/src/mirall/owncloudgui.cpp
@@ -81,7 +81,7 @@ ownCloudGui::ownCloudGui(Application *parent) :
 }
 
 // This should rather be in application.... or rather in MirallConfigFile?
-bool ownCloudGui::checkAccountExists(bool openSettings)
+void ownCloudGui::slotOpenSettingsDialog( bool openSettings )
 {
     // if account is set up, start the configuration wizard.
     if( AccountManager::instance()->account() ) {
@@ -91,13 +91,10 @@ bool ownCloudGui::checkAccountExists(bool openSettings)
             } else {
                 _settingsDialog->close();
             }
-
         }
-        return true;
     } else {
         qDebug() << "No configured folders yet, starting setup wizard";
         OwncloudSetupWizard::runWizard(qApp, SLOT(slotownCloudWizardDone(int)));
-        return false;
     }
 }
 
@@ -112,7 +109,7 @@ void ownCloudGui::slotTrayClicked( QSystemTrayIcon::ActivationReason reason )
     // Linux, not on Mac. They want a menu entry.
 #if !defined Q_OS_MAC
     if( reason == QSystemTrayIcon::Trigger ) {
-        checkAccountExists(true); // start settings if config is existing.
+        slotOpenSettingsDialog(true); // start settings if config is existing.
     }
 #endif
 }
diff --git a/src/mirall/owncloudgui.h b/src/mirall/owncloudgui.h
index d1018d2..074433a 100644
--- a/src/mirall/owncloudgui.h
+++ b/src/mirall/owncloudgui.h
@@ -65,6 +65,7 @@ public slots:
     void slotTrayClicked( QSystemTrayIcon::ActivationReason reason );
     void slotToggleLogBrowser();
     void slotOpenOwnCloud();
+    void slotOpenSettingsDialog( bool openSettings );
     void slotHelp();
     void slotOpenPath(const QString& path);
     void slotAccountStateChanged();

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