From ce8c7161fb5c7acd6e1f92b62d28c319387e6b7a Mon Sep 17 00:00:00 2001 From: aviau <alexandre@alexandreviau.net> Date: Fri, 2 Sep 2016 14:16:23 -0400 Subject: [PATCH] Detect removed accounts by other clients or dring This patch makes sure that LRC will notice accounts that are removed by other clients or by the daemon. Change-Id: Icf766614d54f7163311fa1862ace3b65bc655750 Tuleap: #995 --- src/accountmodel.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/accountmodel.cpp b/src/accountmodel.cpp index 0191c3a6..eb98ab41 100644 --- a/src/accountmodel.cpp +++ b/src/accountmodel.cpp @@ -457,6 +457,14 @@ void AccountModel::updateAccounts() qDebug() << "Updating all accounts"; ConfigurationManagerInterface& configurationManager = ConfigurationManager::instance(); QStringList accountIds = configurationManager.getAccountList(); + + // Detect removed accounts + foreach(Account* account, d_ptr->m_lAccounts) { + if (accountIds.indexOf(account->id()) == -1) { + remove(account); + } + } + //m_lAccounts.clear(); for (int i = 0; i < accountIds.size(); ++i) { Account* acc = getById(accountIds[i].toLatin1()); -- GitLab