Skip to content

Commit

Permalink
Improve log output when migrating settings.
Browse files Browse the repository at this point in the history
Signed-off-by: Camila Ayres <[email protected]>
  • Loading branch information
camilasan committed Jan 29, 2025
1 parent 0d966d7 commit 53e7b9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/gui/accountmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void AccountManager::backwardMigrationSettingsKeys(QStringList *deleteKeys, QStr
}
} else {
deleteKeys->append(settings->group());
}
}
}

bool AccountManager::restoreFromLegacySettings()
Expand Down Expand Up @@ -273,9 +273,7 @@ bool AccountManager::restoreFromLegacySettings()
oCSettings->endGroup();
}
} else {
// skip updater settings
oCSettings->remove(QLatin1String(updaterC));
qCInfo(lcAccountManager) << "Copy settings" << oCSettings->allKeys().join(", ");
qCInfo(lcAccountManager) << "Copy settings:" << oCSettings->allKeys().join(", ");
settings = std::move(oCSettings);
}

Expand Down
3 changes: 3 additions & 0 deletions src/gui/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,16 @@ bool Application::configVersionMigration()
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
return false;
}
}

if (!deleteKeys.isEmpty()) {
auto settings = ConfigFile::settingsWithGroup("foo");
settings->endGroup();

// Wipe confusing keys from the future, ignore the others
for (const auto &badKey : std::as_const(deleteKeys)) {
settings->remove(badKey);
qCInfo(lcApplication) << "Migration: removed" << badKey << "key from settings.";
}
}

Expand Down

0 comments on commit 53e7b9c

Please sign in to comment.