Skip to content

Commit 3673f77

Browse files
committed
settings.cpp: fix bug whereby initial int value of 0 in rc.xml is handled wrong
1 parent 7785af8 commit 3673f77

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/settings.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Setting::Setting(QString name, enum settingFileType fileType, enum settingValueT
6464
}
6565
case LAB_VALUE_TYPE_INT: {
6666
int value = xml_get_int(m_name.toStdString().c_str());
67-
if (value && (value != std::get<int>(m_value))) {
67+
if (value != std::get<int>(m_value)) {
6868
m_valueOrigin = LAB_VALUE_ORIGIN_USER_OVERRIDE;
6969
m_value = value;
7070
info("[user-override] {}: {}", m_name.toStdString(), value);
@@ -147,7 +147,7 @@ QString getStr(QString name)
147147
return nullptr;
148148
}
149149
if (setting->valueType() != LAB_VALUE_TYPE_STRING) {
150-
qDebug() << "getStr(): not valid int setting" << name;
150+
qDebug() << "getStr(): not valid string setting" << name;
151151
}
152152
return std::get<QString>(setting->value());
153153
}
@@ -174,7 +174,7 @@ int getBool(QString name)
174174
return -1;
175175
}
176176
if (setting->valueType() != LAB_VALUE_TYPE_BOOL) {
177-
qDebug() << "getBool(): not valid int setting" << name;
177+
qDebug() << "getBool(): not valid bool setting" << name;
178178
}
179179
return std::get<int>(setting->value());
180180
}

0 commit comments

Comments
 (0)