mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
7046bb4f82
commit
9be028659e
2 changed files with 25 additions and 21 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue