Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

mythgallery: Improve the list of supported image and movie file formats

Since images are read using QImage::load() it is correct to use
QImageReader::supportedImageFormats to specify the list of supported types.

Add *.iso, *.img and *.bin to the list of movie files supoorted by mplayer.

Signed-off-by: Lawrence Rust <lvr@softsystem.co.uk>
Signed-off-by: Stuart Morgan <smorgan@mythtv.org>
  • Loading branch information...
commit c722636fec8a7afc9202863bab58e282fde5b2b5 1 parent 70f02af
Lawrence Rust authored stuartm committed
14 mythplugins/mythgallery/mythgallery/galleryutil.cpp
View
@@ -19,6 +19,7 @@
// qt
#include <QDir>
#include <QApplication>
+#include <QImageReader>
// myth
#include <mythcontext.h>
@@ -54,13 +55,11 @@ static bool FileDelete(const QFileInfo &file);
QStringList GalleryUtil::GetImageFilter(void)
{
QStringList filt;
- filt.push_back("*.jpg");
- filt.push_back("*.jpeg");
- filt.push_back("*.png");
+
+ Q_FOREACH(QByteArray format, QImageReader::supportedImageFormats())
+ filt.push_back("*." + format);
+
filt.push_back("*.tif");
- filt.push_back("*.tiff");
- filt.push_back("*.bmp");
- filt.push_back("*.gif");
#ifdef DCRAW_SUPPORT
filt << DcrawFormats::getFilters();
@@ -73,6 +72,9 @@ QStringList GalleryUtil::GetMovieFilter(void)
{
QStringList filt;
filt.push_back("*.avi");
+ filt.push_back("*.bin");
+ filt.push_back("*.iso");
+ filt.push_back("*.img");
filt.push_back("*.mpg");
filt.push_back("*.mp4");
filt.push_back("*.mpeg");
11 mythplugins/mythgallery/mythgallery/main.cpp
View
@@ -4,6 +4,7 @@
// qt
#include <QDir>
#include <QtPlugin>
+#include <QImageReader>
// myth
#include <mythcontext.h>
@@ -131,9 +132,17 @@ static void setupKeys(void)
REG_MEDIA_HANDLER(QT_TRANSLATE_NOOP("MythControls",
"MythGallery Media Handler 1/2"), "", "", handleMedia,
MEDIATYPE_DATA | MEDIATYPE_MIXED, QString::null);
+ QString filt;
+ Q_FOREACH(QByteArray format, QImageReader::supportedImageFormats())
+ {
+ if (filt.isEmpty())
+ filt = format;
+ else
+ filt += "," + format;
+ }
REG_MEDIA_HANDLER(QT_TRANSLATE_NOOP("MythControls",
"MythGallery Media Handler 2/2"), "", "", handleMedia,
- MEDIATYPE_MGALLERY, "gif,jpg,png");
+ MEDIATYPE_MGALLERY, filt);
}
int mythplugin_init(const char *libversion)
Please sign in to comment.
Something went wrong with that request. Please try again.