mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Remove overwrought loadFromSettings method from AccountState
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
fd4ddfdd4c
commit
74a78242e2
@ -105,14 +105,13 @@ AccountManager::AccountsRestoreResult AccountManager::restore(const bool alsoRes
|
||||
if (!skipSettingsKeys.contains(settings->group())) {
|
||||
if (const auto acc = loadAccountHelper(*settings)) {
|
||||
acc->_id = accountId;
|
||||
if (auto accState = AccountState::loadFromSettings(acc, *settings)) {
|
||||
auto jar = qobject_cast<CookieJar*>(acc->_am->cookieJar());
|
||||
ASSERT(jar);
|
||||
if (jar) {
|
||||
jar->restore(acc->cookieJarPath());
|
||||
}
|
||||
addAccountState(accState);
|
||||
const auto accState = new AccountState(acc);
|
||||
const auto jar = qobject_cast<CookieJar*>(acc->_am->cookieJar());
|
||||
Q_ASSERT(jar);
|
||||
if (jar) {
|
||||
jar->restore(acc->cookieJarPath());
|
||||
}
|
||||
addAccountState(accState);
|
||||
}
|
||||
} else {
|
||||
qCInfo(lcAccountManager) << "Account" << accountId << "is too new, ignoring";
|
||||
|
||||
@ -85,12 +85,6 @@ AccountState::AccountState(const AccountPtr &account)
|
||||
|
||||
AccountState::~AccountState() = default;
|
||||
|
||||
AccountState *AccountState::loadFromSettings(AccountPtr account, QSettings & /*settings*/)
|
||||
{
|
||||
auto accountState = new AccountState(account);
|
||||
return accountState;
|
||||
}
|
||||
|
||||
AccountPtr AccountState::account() const
|
||||
{
|
||||
return _account;
|
||||
|
||||
@ -92,12 +92,6 @@ public:
|
||||
explicit AccountState(const AccountPtr &account);
|
||||
~AccountState() override;
|
||||
|
||||
/** Creates an account state from settings and an Account object.
|
||||
*
|
||||
* Use from AccountManager with a prepared QSettings object only.
|
||||
*/
|
||||
static AccountState *loadFromSettings(AccountPtr account, QSettings &settings);
|
||||
|
||||
AccountPtr account() const;
|
||||
|
||||
ConnectionStatus connectionStatus() const;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user