summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-05 15:56:49 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-05 15:56:49 -0700
commit08689b2f89bc62ad55ab88562d4394d872511075 (patch)
tree8b0fbe21a7cea4f63d02cb9c00113250c6c8b0d4
parent7809077b33dd990c80568ea116d23fee696cfaec (diff)
downloadsubsurface-08689b2f89bc62ad55ab88562d4394d872511075.tar.gz
Correctly parse boolean preferences
QVariant does the right thing, regardless of whether the value is stored as int or as string - so let's just use that instead of manually checking for integers (and failing if the values are stored as "true" and "false"). Fixes #511 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/preferences.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp
index f68ab7014..47f8541db 100644
--- a/qt-ui/preferences.cpp
+++ b/qt-ui/preferences.cpp
@@ -143,7 +143,7 @@ void PreferencesDialog::rememberPrefs()
#define GET_BOOL(name, field) \
v = s.value(QString(name)); \
if (v.isValid()) \
- prefs.field = v.toInt() ? true : false; \
+ prefs.field = v.toBool(); \
else \
prefs.field = default_prefs.field