فهرست منبع

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;
   }