From 2aa9fad0795ead7c7ac1b0e9fc954e9908421ffc Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Thu, 13 Oct 2022 01:20:56 +0300 Subject: [PATCH] kimgio: claim support for all MIME types that are sub-class of image/x-dcraw in raw plugin Signed-off-by: Ivailo Monev --- kimgio/raw.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/kimgio/raw.cpp b/kimgio/raw.cpp index 86fc8700..082dc7ee 100644 --- a/kimgio/raw.cpp +++ b/kimgio/raw.cpp @@ -19,6 +19,7 @@ #include "raw.h" #include +#include #include #include @@ -170,8 +171,16 @@ QStringList RAWPlugin::keys() const QList RAWPlugin::mimeTypes() const { - static const QList list = QList() - << "image/x-dcraw"; + static QList list; + if (list.isEmpty()) { + foreach (const KMimeType::Ptr &mime, KMimeType::allMimeTypes()) { + // NOTE: RAW MIME types are sub-class of image/x-dcraw + if (mime->is(QString::fromLatin1("image/x-dcraw")) + && mime->name() != QLatin1String("image/x-dcraw")) { + list.append(mime->name().toLatin1()); + } + } + } return list; }