From cfbac775da4175ba95442ebd8f932e461d139b9e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
 <sebastien.blin@savoirfairelinux.com>
Date: Wed, 27 Jun 2018 15:38:23 -0400
Subject: [PATCH] newaccountmodel: separate enabled from the configuration and
 if active

Change-Id: I9b9d17936d64bf679f66e06afa1de838f7289ebe
Reviewed-by: Hugo Lefeuvre <hugo.lefeuvre@savoirfairelinux.com>
---
 src/newaccountmodel.cpp | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/src/newaccountmodel.cpp b/src/newaccountmodel.cpp
index db122cef..a51f3b9b 100644
--- a/src/newaccountmodel.cpp
+++ b/src/newaccountmodel.cpp
@@ -310,14 +310,7 @@ NewAccountModelPimpl::slotAccountStatusChanged(const std::string& accountID, con
         emit linked.accountAdded(accountID);
     } else if (accountInfo != accounts.end()) {
         accountInfo->second.status = status;
-        if (status == api::account::Status::REGISTERED and not accounts[accountID].enabled) {
-            accounts[accountID].enabled = true;
-            emit linked.accountStatusChanged(accountID);
-        } else if (status == api::account::Status::UNREGISTERED and accounts[accountID].enabled) {
-            accounts[accountID].enabled = false;
-            emit linked.accountStatusChanged(accountID);
-        } else
-            emit linked.accountStatusChanged(accountID);
+        emit linked.accountStatusChanged(accountID);
     }
 }
 
-- 
GitLab