From 488914b30f0d95d99160dafff032e1c55ea9e733 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 19 Aug 2024 14:55:12 +0200 Subject: [PATCH] Use "on"/"off" when displaying bool parameters This is a lot more readable than "0"/"1", which can easily be confused with integer parameters. Note that this breaks some backwards compatibility. Older clients will not be able to parse configuration files generated by newer clients, as they had a bug where they could only understand "0" and "1". --- common/rfb/Configuration.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/rfb/Configuration.cxx b/common/rfb/Configuration.cxx index 4e4b27d2d5..1b09275dbf 100644 --- a/common/rfb/Configuration.cxx +++ b/common/rfb/Configuration.cxx @@ -274,15 +274,15 @@ bool BoolParameter::setParam() { void BoolParameter::setParam(bool b) { if (immutable) return; value = b; - vlog.debug("Set %s(Bool) to %d", getName(), value); + vlog.debug("Set %s(Bool) to %s", getName(), getValueStr().c_str()); } std::string BoolParameter::getDefaultStr() const { - return def_value ? "1" : "0"; + return def_value ? "on" : "off"; } std::string BoolParameter::getValueStr() const { - return value ? "1" : "0"; + return value ? "on" : "off"; } BoolParameter::operator bool() const {