From b28dba6087f0433af8ece176b64fcac54ca370a4 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 15 May 2018 20:47:35 +0200 Subject: 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 --- core/qthelper.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'core/qthelper.cpp') 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; } -- cgit v1.2.3-70-g09d2