Replace isQuitting flag with disconnect()
authorSergey Zolotarev <sryze@protonmail.com>
Wed, 9 Oct 2019 05:07:00 +0000 (11:07 +0600)
committerSergey Zolotarev <sryze@protonmail.com>
Wed, 9 Oct 2019 05:07:00 +0000 (11:07 +0600)
Signed-off-by: Sergey Zolotarev <sryze@protonmail.com>
src/gui/application.cpp
src/gui/application.h

index 9b38fb1b7c6acb9e84e24df4d5e1eb85a22f7f85..24a8a25b98cdc934fda37f9e5f099e4350b05990 100644 (file)
@@ -108,7 +108,6 @@ Application::Application(int &argc, char **argv)
     , _userTriggeredConnect(false)
     , _debugMode(false)
     , _backgroundMode(false)
-    , _isQuitting(false)
 {
     _startedAt.start();
 
@@ -265,6 +264,8 @@ Application::~Application()
     }
 
     // Remove the account from the account manager so it can be deleted.
+    disconnect(AccountManager::instance(), &AccountManager::accountRemoved,
+        this, &Application::slotAccountStateRemoved);
     AccountManager::instance()->shutdown();
 }
 
@@ -284,7 +285,7 @@ void Application::slotAccountStateRemoved(AccountState *accountState)
     }
 
     // if there is no more account, show the wizard.
-    if (!_isQuitting && AccountManager::instance()->accounts().isEmpty()) {
+    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)));
@@ -307,8 +308,6 @@ void Application::slotAccountStateAdded(AccountState *accountState)
 
 void Application::slotCleanup()
 {
-    _isQuitting = true;
-
     AccountManager::instance()->save();
     FolderMan::instance()->unloadAndDeleteAllFolders();
 
index f0e24548e29e3b2bd725a6ecddaa65022efc25b0..77abd7a97e19827dcee5e9d57d7c2d301937dbd1 100644 (file)
@@ -114,7 +114,6 @@ private:
     bool _userTriggeredConnect;
     bool _debugMode;
     bool _backgroundMode;
-    bool _isQuitting;
 
     ClientProxy _proxy;