mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-23 01:25:58 +01:00
set default var if not present in config
This commit is contained in:
parent
24316f2e71
commit
cec248d176
2 changed files with 9 additions and 1 deletions
|
@ -11,6 +11,10 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
CConfigManager::CConfigManager() {
|
CConfigManager::CConfigManager() {
|
||||||
|
setDefaultVars();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CConfigManager::setDefaultVars() {
|
||||||
configValues["general:max_fps"].intValue = 240;
|
configValues["general:max_fps"].intValue = 240;
|
||||||
configValues["general:sensitivity"].floatValue = 0.25f;
|
configValues["general:sensitivity"].floatValue = 0.25f;
|
||||||
configValues["general:apply_sens_to_raw"].intValue = 1;
|
configValues["general:apply_sens_to_raw"].intValue = 1;
|
||||||
|
@ -309,7 +313,9 @@ void CConfigManager::loadConfigLoadVars() {
|
||||||
Debug::log(LOG, "Reloading the config!");
|
Debug::log(LOG, "Reloading the config!");
|
||||||
parseError = ""; // reset the error
|
parseError = ""; // reset the error
|
||||||
currentCategory = ""; // reset the category
|
currentCategory = ""; // reset the category
|
||||||
configValues["autogenerated"].intValue = 0; // reset autogenerated status
|
|
||||||
|
// reset all vars before loading
|
||||||
|
setDefaultVars();
|
||||||
|
|
||||||
m_dMonitorRules.clear();
|
m_dMonitorRules.clear();
|
||||||
m_dWindowRules.clear();
|
m_dWindowRules.clear();
|
||||||
|
|
|
@ -72,6 +72,8 @@ private:
|
||||||
std::deque<std::string> firstExecRequests;
|
std::deque<std::string> firstExecRequests;
|
||||||
|
|
||||||
// internal methods
|
// internal methods
|
||||||
|
void setDefaultVars();
|
||||||
|
|
||||||
void loadConfigLoadVars();
|
void loadConfigLoadVars();
|
||||||
SConfigValue getConfigValueSafe(std::string);
|
SConfigValue getConfigValueSafe(std::string);
|
||||||
void parseLine(std::string&);
|
void parseLine(std::string&);
|
||||||
|
|
Loading…
Reference in a new issue