void AccountsManager::InitiateAccountAddition () { const auto acc = std::make_shared<Account> (ProgressMgr_); acc->OpenConfigDialog ([acc, this] { if (acc->IsNull ()) return; AddAccountImpl (acc); saveAccounts (); }); }
void Core::LoadAccounts () { QSettings settings (QCoreApplication::organizationName (), QCoreApplication::applicationName () + "_Snails_Accounts"); Q_FOREACH (const QVariant& var, settings.value ("Accounts").toList ()) { Account_ptr acc (new Account); try { acc->Deserialize (var.toByteArray ()); } catch (const std::exception& e) { qWarning () << Q_FUNC_INFO << "unable to deserialize account, sorry :(" << e.what (); continue; } AddAccountImpl (acc); } }
void AccountsManager::LoadAccounts () { QSettings settings (QCoreApplication::organizationName (), QCoreApplication::applicationName () + "_Snails_Accounts"); for (const auto& var : settings.value ("Accounts").toList ()) { const auto acc = std::make_shared<Account> (ProgressMgr_); try { acc->Deserialize (var.toByteArray ()); } catch (const std::exception& e) { qWarning () << Q_FUNC_INFO << "unable to deserialize account, sorry :(" << e.what (); continue; } AddAccountImpl (acc); } }
void Core::AddAccount (Account_ptr account) { AddAccountImpl (account); saveAccounts (); }
void AccountsManager::AddAccount (Account_ptr account) { AddAccountImpl (account); saveAccounts (); }