diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 54bc2c0c..30585502 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -11,6 +11,10 @@ #include CConfigManager::CConfigManager() { + setDefaultVars(); +} + +void CConfigManager::setDefaultVars() { configValues["general:max_fps"].intValue = 240; configValues["general:sensitivity"].floatValue = 0.25f; configValues["general:apply_sens_to_raw"].intValue = 1; @@ -309,7 +313,9 @@ void CConfigManager::loadConfigLoadVars() { Debug::log(LOG, "Reloading the config!"); parseError = ""; // reset the error currentCategory = ""; // reset the category - configValues["autogenerated"].intValue = 0; // reset autogenerated status + + // reset all vars before loading + setDefaultVars(); m_dMonitorRules.clear(); m_dWindowRules.clear(); diff --git a/src/config/ConfigManager.hpp b/src/config/ConfigManager.hpp index e1e21dd2..ae61ba44 100644 --- a/src/config/ConfigManager.hpp +++ b/src/config/ConfigManager.hpp @@ -72,6 +72,8 @@ private: std::deque firstExecRequests; // internal methods + void setDefaultVars(); + void loadConfigLoadVars(); SConfigValue getConfigValueSafe(std::string); void parseLine(std::string&);