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>
This commit is contained in:
Dirk Hohndel 2014-05-05 15:56:49 -07:00
parent 7809077b33
commit 08689b2f89

View file

@ -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