[Pkg-owncloud-commits] [owncloud-client] 450/484: Account removal: Do it inside global application object
Sandro Knauß
hefee-guest at moszumanska.debian.org
Wed Dec 16 00:38:20 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 db7d70a929dd99d0a5ff076de801d7fc09883ca5
Author: Markus Goetz <markus at woboq.com>
Date: Tue Dec 1 16:30:57 2015 +0100
Account removal: Do it inside global application object
For #4229 #4202
---
src/gui/accountsettings.cpp | 10 ++--------
src/gui/application.cpp | 8 ++++++++
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp
index ff7953f..ff63691 100644
--- a/src/gui/accountsettings.cpp
+++ b/src/gui/accountsettings.cpp
@@ -693,14 +693,8 @@ void AccountSettings::slotDeleteAccount()
manager->deleteAccount(_accountState);
manager->save();
- // if there is no more account, show the wizard.
- if( manager->accounts().isEmpty() ) {
- // allow to add a new account if there is non any more. Always think
- // about single account theming!
- _addAccountAction->setVisible(true);
- OwncloudSetupWizard::runWizard(qApp, SLOT(slotownCloudWizardDone(int)));
- }
-
+ // IMPORTANT: "this" is deleted from this point on. We should probably remove this synchronous
+ // .exec() QMessageBox magic above as it recurses into the event loop.
}
bool AccountSettings::event(QEvent* e)
diff --git a/src/gui/application.cpp b/src/gui/application.cpp
index 62ccea9..2d4622b 100644
--- a/src/gui/application.cpp
+++ b/src/gui/application.cpp
@@ -36,6 +36,7 @@
#include "creds/abstractcredentials.h"
#include "updater/ocupdater.h"
#include "excludedfiles.h"
+#include "owncloudsetupwizard.h"
#include "config.h"
@@ -219,6 +220,13 @@ void Application::slotAccountStateRemoved(AccountState *accountState)
disconnect(accountState, SIGNAL(stateChanged(int)),
_folderManager.data(), SLOT(slotAccountStateChanged()));
}
+
+ // if there is no more account, show the wizard.
+ if( AccountManager::instance()->accounts().isEmpty() ) {
+ // allow to add a new account if there is non any more. Always think
+ // about single account theming!
+ OwncloudSetupWizard::runWizard(this, SLOT(slotownCloudWizardDone(int)));
+ }
}
void Application::slotAccountStateAdded(AccountState *accountState)
--
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