Ver código fonte

Always overwrite/create the config file if it could not be loaded

Instead of doing this at a random later point. (Or risking that it
doesn't happen at all.)
Vincent Lang 9 anos atrás
pai
commit
cb28e77910
1 arquivos alterados com 5 adições e 0 exclusões
  1. 5 0
      src/settings/SettingsComponent.cpp

+ 5 - 0
src/settings/SettingsComponent.cpp

@@ -117,6 +117,11 @@ void SettingsComponent::loadConf(const QString& path, bool storage)
       QLOG_ERROR() << "Could not read config file.";
     else
       QLOG_ERROR() << "Config version is" << version << "but" << m_settingsVersion << "expected. Moving old config to" << backup;
+    // Overwrite/create it with the defaults.
+    if (storage)
+      saveStorage();
+    else
+      saveSettings();
     return;
   }