diff options
author | Liang Qi <liang.qi@qt.io> | 2018-11-12 09:40:47 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-11-15 17:20:15 +0000 |
commit | 527406cbd99f44470ef87468b73c18df949e8ac7 (patch) | |
tree | 4ee73cffee4bf8699ce45d902aa9b30c6ebb1cc4 /src/widgets/dialogs/qfiledialog.cpp | |
parent | cd201b2c2c2849fea0c5a38ffd979cd9d5b24997 (diff) |
Modernize the "settings" feature
Change-Id: I9b8a61ecb1413b513ae5c9e77d3ee1b3e8b6562c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/widgets/dialogs/qfiledialog.cpp')
-rw-r--r-- | src/widgets/dialogs/qfiledialog.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 778e8556c7..8a51c7d186 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -57,7 +57,9 @@ #include <qmessagebox.h> #endif #include <stdlib.h> +#if QT_CONFIG(settings) #include <qsettings.h> +#endif #include <qdebug.h> #if QT_CONFIG(mimetype) #include <qmimedatabase.h> @@ -383,7 +385,7 @@ QFileDialog::QFileDialog(const QFileDialogArgs &args) */ QFileDialog::~QFileDialog() { -#ifndef QT_NO_SETTINGS +#if QT_CONFIG(settings) Q_D(QFileDialog); d->saveSettings(); #endif @@ -2723,7 +2725,7 @@ void QFileDialog::accept() } } -#ifndef QT_NO_SETTINGS +#if QT_CONFIG(settings) void QFileDialogPrivate::saveSettings() { Q_Q(QFileDialog); @@ -2781,7 +2783,7 @@ bool QFileDialogPrivate::restoreFromSettings() return restoreWidgetState(history, settings.value(QLatin1String("sidebarWidth"), -1).toInt()); } -#endif // QT_NO_SETTINGS +#endif // settings bool QFileDialogPrivate::restoreWidgetState(QStringList &history, int splitterPosition) { @@ -2854,7 +2856,7 @@ void QFileDialogPrivate::init(const QUrl &directory, const QString &nameFilter, else q->selectUrl(directory); -#ifndef QT_NO_SETTINGS +#if QT_CONFIG(settings) // Try to restore from the FileDialog settings group; if it fails, fall back // to the pre-5.5 QByteArray serialized settings. if (!restoreFromSettings()) { @@ -3019,7 +3021,7 @@ void QFileDialogPrivate::createWidgets() createToolButtons(); createMenuActions(); -#ifndef QT_NO_SETTINGS +#if QT_CONFIG(settings) // Try to restore from the FileDialog settings group; if it fails, fall back // to the pre-5.5 QByteArray serialized settings. if (!restoreFromSettings()) { |