summaryrefslogtreecommitdiffstats
path: root/core/qthelper.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-05-15 20:47:35 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-07-08 07:41:15 -0700
commitb28dba6087f0433af8ece176b64fcac54ca370a4 (patch)
tree58301772930e3f50f64a92da2bbd1ac1cbc84e3e /core/qthelper.cpp
parent9a844a075c0e964a21a3bfef22324fbcec88544d (diff)
downloadsubsurface-b28dba6087f0433af8ece176b64fcac54ca370a4.tar.gz
Dive pictures: Recognize video files
When generating thumbnails, test for video files. If it is, use a dummy-thumbnail. Write only the type (video), but no image to the thumbnail cache, for forward-compatibility. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/qthelper.cpp')
-rw-r--r--core/qthelper.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/qthelper.cpp b/core/qthelper.cpp
index 299f8771b..ed3de1a11 100644
--- a/core/qthelper.cpp
+++ b/core/qthelper.cpp
@@ -1209,11 +1209,19 @@ QString localFilePath(const QString &originalFilename)
return localFilenameOf.value(originalFilename, originalFilename);
}
+// TODO: Apparently Qt has no simple way of listing the supported video
+// codecs? Do we have to query them by hand using QMediaPlayer::hasSupport()?
+const QStringList videoExtensionsList = {
+ ".avi", ".mp4", ".mpeg", ".mpg", ".wmv"
+};
+
QStringList imageExtensionFilters() {
QStringList filters;
foreach (QString format, QImageReader::supportedImageFormats()) {
filters.append(QString("*.").append(format));
}
+ foreach (const QString &format, videoExtensionsList)
+ filters.append("*" + format);
return filters;
}