| 717 | |
| 718 | |
| 719 | void AccountList::tryNext() { |
| 720 | while (m_refreshQueue.length()) { |
| 721 | auto accountId = m_refreshQueue.front(); |
| 722 | m_refreshQueue.pop_front(); |
| 723 | for(int i = 0; i < count(); i++) { |
| 724 | auto account = at(i); |
| 725 | if(account->internalId() == accountId) { |
| 726 | m_currentTask = account->refresh(); |
| 727 | if(m_currentTask) { |
| 728 | connect(m_currentTask.get(), &AccountTask::succeeded, this, &AccountList::authSucceeded); |
| 729 | connect(m_currentTask.get(), &AccountTask::failed, this, &AccountList::authFailed); |
| 730 | m_currentTask->start(); |
| 731 | qDebug() << "RefreshSchedule: Processing account " << account->accountDisplayString() << " with internal ID " << accountId; |
| 732 | return; |
| 733 | } |
| 734 | } |
| 735 | } |
| 736 | qDebug() << "RefreshSchedule: Account with with internal ID " << accountId << " not found."; |
| 737 | } |
| 738 | // if we get here, no account needed refreshing. Schedule refresh in an hour. |
| 739 | m_refreshTimer->start(1000 * 3600); |
| 740 | } |
| 741 | |
| 742 | void AccountList::authSucceeded() { |
| 743 | qDebug() << "RefreshSchedule: Background account refresh succeeded"; |
nothing calls this directly
no test coverage detected