bool AccountManager::restore() { auto settings = Account::settingsWithGroup(QLatin1String(accountsC)); // If there are no accounts, check the old format. if (settings->childGroups().isEmpty()) { return restoreFromLegacySettings(); } foreach (const auto& accountId, settings->childGroups()) { settings->beginGroup(accountId); if (auto acc = load(*settings)) { acc->_id = accountId; addAccount(acc); } settings->endGroup(); } return true; }
bool AccountManager::restore() { auto settings = Utility::settingsWithGroup(QLatin1String(accountsC)); // If there are no accounts, check the old format. if (settings->childGroups().isEmpty() && !settings->contains(QLatin1String(versionC))) { return restoreFromLegacySettings(); } foreach (const auto& accountId, settings->childGroups()) { settings->beginGroup(accountId); if (auto acc = loadAccountHelper(*settings)) { acc->_id = accountId; if (auto accState = AccountState::loadFromSettings(acc, *settings)) { addAccountState(accState); } } settings->endGroup(); } return true; }