client: Fix SettingsPage::hasChanged() failure
authorShane Synan <digitalcircuit36939@gmail.com>
Thu, 14 Jun 2018 03:36:28 +0000 (22:36 -0500)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sat, 16 Jun 2018 19:20:42 +0000 (21:20 +0200)
Fix SettingsPage::hasChanged() to compare with the correct property,
"storedValue", instead of "StoredValue".  This resulted in the
settings page sometimes errantly marking values as not changed when
they were, or vice-versa.

Some settings pages could probably be cleaned up now that this is
fixed.  That is left for future cleanup efforts.

src/uisupport/settingspage.cpp

index 9e9551a..bb9d934 100644 (file)
@@ -50,40 +50,41 @@ void SettingsPage::setChangedState(bool hasChanged_)
 
 void SettingsPage::load(QCheckBox *box, bool checked)
 {
 
 void SettingsPage::load(QCheckBox *box, bool checked)
 {
-    box->setProperty("StoredValue", checked);
+    box->setProperty("storedValue", checked);
     box->setChecked(checked);
 }
 
 
 bool SettingsPage::hasChanged(QCheckBox *box)
 {
     box->setChecked(checked);
 }
 
 
 bool SettingsPage::hasChanged(QCheckBox *box)
 {
-    return box->property("StoredValue").toBool() != box->isChecked();
+    return box->property("storedValue").toBool() != box->isChecked();
 }
 
 
 void SettingsPage::load(QComboBox *box, int index)
 {
 }
 
 
 void SettingsPage::load(QComboBox *box, int index)
 {
-    box->setProperty("StoredValue", index);
+    box->setProperty("storedValue", index);
     box->setCurrentIndex(index);
 }
 
 
 bool SettingsPage::hasChanged(QComboBox *box)
 {
     box->setCurrentIndex(index);
 }
 
 
 bool SettingsPage::hasChanged(QComboBox *box)
 {
-    return box->property("StoredValue").toInt() != box->currentIndex();
+    return box->property("storedValue").toInt() != box->currentIndex();
 }
 
 
 void SettingsPage::load(QSpinBox *box, int value)
 {
 }
 
 
 void SettingsPage::load(QSpinBox *box, int value)
 {
-    box->setProperty("StoredValue", value);
+    box->setProperty("storedValue", value);
     box->setValue(value);
 }
 
 
 bool SettingsPage::hasChanged(QSpinBox *box)
 {
     box->setValue(value);
 }
 
 
 bool SettingsPage::hasChanged(QSpinBox *box)
 {
-    return box->property("StoredValue").toInt() != box->value();
+    return box->property("storedValue").toInt() != box->value();
+}
 }
 
 
 }