summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformdialoghelper.h
diff options
context:
space:
mode:
authorElvis Angelaccio <elvis.angelaccio@kde.org>2016-09-05 12:32:35 +0200
committerDavid Faure <david.faure@kdab.com>2017-01-06 16:27:41 +0000
commit34f82b8abcb279542b6350e70609c549e39caafb (patch)
treead66121fcdd09f6e1278e1142f9e17a264863373 /src/gui/kernel/qplatformdialoghelper.h
parentbc80cef1d4bb07605cba81de082625f07fc4136b (diff)
Improve mime type filters in QFileDialog
This patch improves the handling of mime type filters in QFileDialog. The main change is in selectMimeTypeFilter(), which was just falling back unconditionally on selectNameFilter(). Instead, mime type filters should have an higher priority than name filters. This patch also adds a new selectedMimeTypeFilter() method, which is used in the unit test. Change-Id: Ice8bb08f5ff46e4a942d539f6001424eca878f74 Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/gui/kernel/qplatformdialoghelper.h')
-rw-r--r--src/gui/kernel/qplatformdialoghelper.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformdialoghelper.h b/src/gui/kernel/qplatformdialoghelper.h
index 6caef070e2..ed88c19c84 100644
--- a/src/gui/kernel/qplatformdialoghelper.h
+++ b/src/gui/kernel/qplatformdialoghelper.h
@@ -372,6 +372,9 @@ public:
QUrl initialDirectory() const;
void setInitialDirectory(const QUrl &);
+ QString initiallySelectedMimeTypeFilter() const;
+ void setInitiallySelectedMimeTypeFilter(const QString &);
+
QString initiallySelectedNameFilter() const;
void setInitiallySelectedNameFilter(const QString &);
@@ -397,7 +400,9 @@ public:
virtual void selectFile(const QUrl &filename) = 0;
virtual QList<QUrl> selectedFiles() const = 0;
virtual void setFilter() = 0;
+ virtual void selectMimeTypeFilter(const QString &filter);
virtual void selectNameFilter(const QString &filter) = 0;
+ virtual QString selectedMimeTypeFilter() const;
virtual QString selectedNameFilter() const = 0;
virtual bool isSupportedUrl(const QUrl &url) const;