summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs/qfiledialog_p.h
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2013-08-21 10:08:50 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-15 08:14:48 +0200
commit37ca2224eca671200a2710f57f970d2993e62aa5 (patch)
tree79800f85b1d34e09fd9b2a16b4e5079152db4b8f /src/widgets/dialogs/qfiledialog_p.h
parent5c301f4121b4395b968ef3d6404986326ce70048 (diff)
QFileDialog: don't create widgets if the platform dialog will be used
This is a performance and memory optimization which also fixes bugs that are related to creating widgets, file system models etc. despite using platform native dialogs. Similar to 785bc64f8e743ac269f15cbe7fecba93d3d507ac for QColorDialog. Task-number: QTBUG-33039 Change-Id: Ia1aa7ec1f43b47006b9ebd377aed15c958538a17 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/widgets/dialogs/qfiledialog_p.h')
-rw-r--r--src/widgets/dialogs/qfiledialog_p.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h
index e5a558bb91..36336bdbf6 100644
--- a/src/widgets/dialogs/qfiledialog_p.h
+++ b/src/widgets/dialogs/qfiledialog_p.h
@@ -135,8 +135,11 @@ public:
QList<QUrl> addDefaultSuffixToUrls(const QList<QUrl> &urlsToFix) const;
bool removeDirectory(const QString &path);
void setLabelTextControl(QFileDialog::DialogLabel label, const QString &text);
+ inline void updateLookInLabel();
inline void updateFileNameLabel();
+ inline void updateFileTypeLabel();
void updateOkButtonText(bool saveAsOnFolder = false);
+ void updateCancelButtonText();
inline QModelIndex mapToSource(const QModelIndex &index) const;
inline QModelIndex mapFromSource(const QModelIndex &index) const;
@@ -249,6 +252,7 @@ public:
// dialog. Returning false means that a non-native dialog must be
// used instead.
bool canBeNativeDialog();
+ inline bool usingWidgets() const;
void setDirectory_sys(const QUrl &directory);
QUrl directory_sys() const;
@@ -347,7 +351,7 @@ inline QModelIndex QFileDialogPrivate::mapFromSource(const QModelIndex &index) c
}
inline QString QFileDialogPrivate::rootPath() const {
- return model->rootPath();
+ return (model ? model->rootPath() : QStringLiteral("/"));
}
inline void QFileDialogPrivate::setDirectory_sys(const QUrl &directory)