Prefer settings DB for import in case of ambiguity.

This commit is contained in:
Christian Speckner 2021-01-02 16:08:43 +01:00
parent e06b58efaf
commit 5888ea2adb
1 changed files with 6 additions and 6 deletions

View File

@ -81,12 +81,7 @@ void SettingsDb::initializeDb() {
FilesystemNode legacyConfigDatabase{myDatabaseDirectory};
legacyConfigDatabase /= "settings.sqlite3";
if (legacyConfigFile.exists() && legacyConfigFile.isFile()) {
Logger::info("importing old settings from " + legacyConfigFile.getPath());
mySettingsRepository->save(KeyValueRepositoryConfigfile{legacyConfigFile}.load());
}
else if (legacyConfigDatabase.exists() && legacyConfigDatabase.isFile()) {
if (legacyConfigDatabase.exists() && legacyConfigDatabase.isFile()) {
Logger::info("importing old settings from " + legacyConfigDatabase.getPath());
try {
@ -104,6 +99,11 @@ void SettingsDb::initializeDb() {
Logger::error(err.what());
}
}
else if (legacyConfigFile.exists() && legacyConfigFile.isFile()) {
Logger::info("importing old settings from " + legacyConfigFile.getPath());
mySettingsRepository->save(KeyValueRepositoryConfigfile(legacyConfigFile).load());
}
myDb->setUserVersion(CURRENT_VERSION);
}