diff options
author | Stefan Fuchs <sfuchs@gmx.de> | 2018-07-13 21:06:28 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-07-15 09:38:12 -0700 |
commit | bb2dfdfe5448eb7616c0d2eb432c633bce2a520a (patch) | |
tree | eda0d1686e6611539032bd89630de14aae8b8deb /core/qthelper.cpp | |
parent | 669277d49004fefc320906297a1c08a26e6d99d7 (diff) | |
download | subsurface-bb2dfdfe5448eb7616c0d2eb432c633bce2a520a.tar.gz |
For media file open dialog add different file filters
On top of the file filter for all media files add a file filter
for images only, one for videos only and one for all files.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Diffstat (limited to 'core/qthelper.cpp')
-rw-r--r-- | core/qthelper.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/core/qthelper.cpp b/core/qthelper.cpp index 3ca48c480..6ee0cb6ae 100644 --- a/core/qthelper.cpp +++ b/core/qthelper.cpp @@ -1215,11 +1215,22 @@ const QStringList videoExtensionsList = { ".avi", ".mp4", ".mov", ".mpeg", ".mpg", ".wmv" }; -QStringList imageExtensionFilters() { +QStringList mediaExtensionFilters() +{ + return imageExtensionFilters() + videoExtensionFilters(); +} + +QStringList imageExtensionFilters() +{ + QStringList filters; + foreach (const QString &format, QImageReader::supportedImageFormats()) + filters.append("*." + format); + return filters; +} + +QStringList videoExtensionFilters() +{ QStringList filters; - foreach (QString format, QImageReader::supportedImageFormats()) { - filters.append(QString("*.").append(format)); - } foreach (const QString &format, videoExtensionsList) filters.append("*" + format); return filters; |