浏览代码

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 年之前
父节点
当前提交
cb28e77910
共有 1 个文件被更改,包括 5 次插入0 次删除
  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;
   }