AccountSettings: Show the wizard to add an account when the last account was deleted...
authorOlivier Goffart <ogoffart@woboq.com>
Fri, 7 Aug 2015 11:14:33 +0000 (13:14 +0200)
committerOlivier Goffart <ogoffart@woboq.com>
Fri, 7 Aug 2015 11:15:02 +0000 (13:15 +0200)
src/gui/accountsettings.cpp

index 335aef32d21d2b4b6a5c9fea54b3a88a7eb926e2..e8a0c34288ff96e3aa3ebac46f5eba4ab46b2057 100644 (file)
@@ -27,6 +27,7 @@
 #include "accountstate.h"
 #include "quotainfo.h"
 #include "accountmanager.h"
+#include "owncloudsetupwizard.h"
 #include "creds/abstractcredentials.h"
 
 #include <math.h>
@@ -529,6 +530,12 @@ void AccountSettings::slotDeleteAccount()
     auto manager = AccountManager::instance();
     manager->deleteAccount(_accountState);
     manager->save();
+
+    // if there is no more account, show the wizard.
+    if( manager->accounts().isEmpty() ) {
+        OwncloudSetupWizard::runWizard(qApp, SLOT(slotownCloudWizardDone(int)));
+    }
+
 }
 
 bool AccountSettings::event(QEvent* e)