diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2019-12-28 10:16:55 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-12-29 12:31:43 -0800 |
commit | 9be028659edb24d188c9b8996dfb597009c2a34b (patch) | |
tree | ad23446c49de5ef098bcf0d331572a96a12d827c /core | |
parent | 7046bb4f82e8c63a12d85ac8e22e83b346747e9c (diff) | |
download | subsurface-9be028659edb24d188c9b8996dfb597009c2a34b.tar.gz |
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 <dirk@hohndel.org>
Diffstat (limited to 'core')
-rw-r--r-- | core/settings/qPrefLog.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
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) |