summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs/qfiledialog.cpp
diff options
context:
space:
mode:
authorAndre Somers <andre.somers@kdab.com>2016-02-02 14:40:29 +0100
committerAndre Somers <andre@familiesomers.nl>2016-02-12 19:32:05 +0000
commit0df5c366e50b9533fd8ea3f31c4c360ae7f4c5b6 (patch)
tree301cb4fa308fb306f65ca2fa55a157ab6a46798d /src/widgets/dialogs/qfiledialog.cpp
parentc5d49725779292a04fed599eb7f508d334ffc5c3 (diff)
Use QFlags::setFlag where prudent in qtbase
QFlags::setFlag is most useful to replace explicit constructs like if (condition) { someFlags |= TheConditionFlag; } else { someFlags &= ~TheConditionFlag; } with someFlags.setFlag(TheConditionFlag, condition); Change-Id: Ie4586681c83e0af812d5bbf14965aad51941a960 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/widgets/dialogs/qfiledialog.cpp')
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 288922d740..d5e59d975d 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -786,10 +786,8 @@ void QFileDialog::setOptions(Options options)
if (changed & DontUseCustomDirectoryIcons) {
QFileIconProvider::Options providerOptions = iconProvider()->options();
- if (options & DontUseCustomDirectoryIcons)
- providerOptions |= QFileIconProvider::DontUseCustomDirectoryIcons;
- else
- providerOptions &= ~QFileIconProvider::DontUseCustomDirectoryIcons;
+ providerOptions.setFlag(QFileIconProvider::DontUseCustomDirectoryIcons,
+ options & DontUseCustomDirectoryIcons);
iconProvider()->setOptions(providerOptions);
}
}
@@ -3717,10 +3715,7 @@ void QFileDialogPrivate::_q_showHidden()
{
Q_Q(QFileDialog);
QDir::Filters dirFilters = q->filter();
- if (showHiddenAction->isChecked())
- dirFilters |= QDir::Hidden;
- else
- dirFilters &= ~QDir::Hidden;
+ dirFilters.setFlag(QDir::Hidden, showHiddenAction->isChecked());
q->setFilter(dirFilters);
}