diff options
author | ckamm <mail@ckamm.de> | 2017-02-08 16:28:50 +0300 |
---|---|---|
committer | Markus Goetz <markus@woboq.com> | 2017-02-08 16:28:50 +0300 |
commit | 4198d9f420f630f2f346a123422f937bfbec88d2 (patch) | |
tree | 5a65fffa2a02d92548102e3e2070638c30e17778 /src/gui/accountmanager.cpp | |
parent | 06579a5c709ed4f9399c7924281bfe1c50785486 (diff) |
Settings: Don't migrate settings on access error #5499 (#5523)
Previously, we'd try migrating from legacy settings if reading
the settings failed with an error. Now, we try again after a
couple of seconds and eventually give up.
Diffstat (limited to 'src/gui/accountmanager.cpp')
-rw-r--r-- | src/gui/accountmanager.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/accountmanager.cpp b/src/gui/accountmanager.cpp index 9d8b3ed41..84ad5d4a5 100644 --- a/src/gui/accountmanager.cpp +++ b/src/gui/accountmanager.cpp @@ -46,11 +46,17 @@ AccountManager *AccountManager::instance() bool AccountManager::restore() { auto settings = Utility::settingsWithGroup(QLatin1String(accountsC)); + if (settings->status() != QSettings::NoError) { + qDebug() << "Could not read settings from" << settings->fileName() + << settings->status(); + return false; + } // If there are no accounts, check the old format. if (settings->childGroups().isEmpty() && !settings->contains(QLatin1String(versionC))) { - return restoreFromLegacySettings(); + restoreFromLegacySettings(); + return true; } foreach (const auto& accountId, settings->childGroups()) { @@ -69,6 +75,9 @@ bool AccountManager::restore() bool AccountManager::restoreFromLegacySettings() { + qDebug() << "Migrate: restoreFromLegacySettings, checking settings group" + << Theme::instance()->appName(); + // try to open the correctly themed settings auto settings = Utility::settingsWithGroup(Theme::instance()->appName()); |