mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 13:35:58 +03:00
Account removal: Do it inside global application object
For #4229 #4202
This commit is contained in:
parent
d2f1c141d8
commit
db7d70a929
2 changed files with 10 additions and 8 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue