Skip to content
Snippets Groups Projects
Commit fbfc1409 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Nicolas Jager
Browse files

AvailableAccountModel: update on state changing


Check account new state and update prior Account only in case when
current prior Account became unavailable.

Change-Id: I74fcc1e056a4afc20fe923789be21c17806cc112
Reviewed-by: default avatarNicolas Jäger <nicolas.jager@savoirfairelinux.com>
parent 59e3cd18
Branches
No related tags found
No related merge requests found
......@@ -235,13 +235,12 @@ void AvailableAccountModelPrivate::checkRemovedAccount(Account* a)
void AvailableAccountModelPrivate::checkStateChanges(Account* account, const Account::RegistrationState state)
{
Q_UNUSED(account)
Q_UNUSED(state)
// change PriorAccount if current PriorAccount became unavailable
if(m_spPriorAccount != account || state == Account::RegistrationState::READY ||
state == Account::RegistrationState::TRYING)
return;
Account* a = firstRegisteredAccount();
if ( m_spPriorAccount != a ) {
qDebug() << "The current default account changed to" << a;
setPriorAccount(a);
}
}
#include <availableaccountmodel.moc>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment