From 9be028659edb24d188c9b8996dfb597009c2a34b Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 28 Dec 2019 10:16:55 -0800 Subject: tests: fix TestQPrefLog There were several issues with these tests, including checking the value argument against bool values even if the underlying preference isn't bool. Signed-off-by: Dirk Hohndel --- core/settings/qPrefLog.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'core/settings') diff --git a/core/settings/qPrefLog.cpp b/core/settings/qPrefLog.cpp index 3a267b56d..c35abe252 100644 --- a/core/settings/qPrefLog.cpp +++ b/core/settings/qPrefLog.cpp @@ -24,15 +24,15 @@ void qPrefLog::set_default_file_behavior(enum def_file_behavior value) if (value != prefs.default_file_behavior || prefs.default_file_behavior != UNDEFINED_DEFAULT_FILE) { - if (value == UNDEFINED_DEFAULT_FILE) { - // undefined, so check if there's a filename set and - // use that, otherwise go with no default file - prefs.default_file_behavior = QString(prefs.default_filename).isEmpty() ? NO_DEFAULT_FILE : LOCAL_DEFAULT_FILE; - } else { - prefs.default_file_behavior = value; - } - disk_default_file_behavior(true); - emit instance()->default_file_behaviorChanged(value); + if (value == UNDEFINED_DEFAULT_FILE) { + // undefined, so check if there's a filename set and + // use that, otherwise go with no default file + prefs.default_file_behavior = QString(prefs.default_filename).isEmpty() ? NO_DEFAULT_FILE : LOCAL_DEFAULT_FILE; + } else { + prefs.default_file_behavior = value; + } + disk_default_file_behavior(true); + emit instance()->default_file_behaviorChanged(value); } } void qPrefLog::disk_default_file_behavior(bool doSync) -- cgit v1.2.3-70-g09d2