mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-23 02:05:58 +01:00
Added yes/no values to int parsing
This commit is contained in:
parent
29e2bb27f6
commit
2d856ac4b0
1 changed files with 6 additions and 1 deletions
|
@ -201,7 +201,12 @@ void CConfigManager::configSetValueSafe(const std::string& COMMAND, const std::s
|
||||||
// Values with 0x are hex
|
// Values with 0x are hex
|
||||||
const auto VALUEWITHOUTHEX = VALUE.substr(2);
|
const auto VALUEWITHOUTHEX = VALUE.substr(2);
|
||||||
CONFIGENTRY->intValue = stol(VALUEWITHOUTHEX, nullptr, 16);
|
CONFIGENTRY->intValue = stol(VALUEWITHOUTHEX, nullptr, 16);
|
||||||
} else
|
} else if (VALUE.find("true") == 0 || VALUE.find("on") == 0 || VALUE.find("yes") == 0) {
|
||||||
|
CONFIGENTRY->intValue = 1;
|
||||||
|
} else if (VALUE.find("false") == 0 || VALUE.find("off") == 0 || VALUE.find("no") == 0) {
|
||||||
|
CONFIGENTRY->intValue = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
CONFIGENTRY->intValue = stol(VALUE);
|
CONFIGENTRY->intValue = stol(VALUE);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
Debug::log(WARN, "Error reading value of %s", COMMAND.c_str());
|
Debug::log(WARN, "Error reading value of %s", COMMAND.c_str());
|
||||||
|
|
Loading…
Reference in a new issue