Commit 13caa156 authored by Martin Koller's avatar Martin Koller
Browse files

Update mimetypes and provide --mimetypes cmdline option

parent 046201e1
......@@ -34,6 +34,7 @@
#include <QApplication>
#include <QCommandLineParser>
#include <QImageReader>
#include <QDir>
#include <KLocalizedString>
......@@ -89,9 +90,24 @@ int main(int argc, char *argv [])
cmdLine.addPositionalArgument(QStringLiteral("files"), i18n("Image files to open, optionally"), QStringLiteral("[files...]"));
aboutData.setupCommandLine(&cmdLine);
cmdLine.addOption(QCommandLineOption("mimetypes", i18n("List all readable image MimeTypes")));
cmdLine.process(app);
aboutData.processCommandLine(&cmdLine);
// produce a list of MimeTypes which kolourpaint can handle (can be used inside the .desktop file)
if ( cmdLine.isSet("mimetypes") )
{
foreach (const QByteArray &type, QImageReader::supportedMimeTypes())
{
if ( !type.isEmpty() )
printf("%s;", type.constData());
}
printf("\n");
return 0;
}
if ( app.isSessionRestored() )
{
// Creates a kpMainWindow using the default constructor and then
......
......@@ -193,10 +193,8 @@ Type=Application
Exec=kolourpaint %u
X-DocPath=kolourpaint/index.html
# SYNC: Run branches/kolourpaint/control/scripts/kde4port/gen_mimetype_line.sh in
# the version of kdelibs/kimgio/ (e.g. KDE 4.0) KolourPaint is
# shipped with.
MimeType=image/avif;image/bmp;image/gif;image/jpeg;image/jp2;image/jpeg2000;image/png;image/tiff;image/x-dds;image/x-eps;image/x-exr;image/x-hdr;image/x-ico;image/vnd.microsoft.icon;image/x-pcx;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-psd;image/x-rgb;image/x-tga;image/x-xbitmap;image/x-xcf;image/x-xpixmap;video/x-mng;image/x-sun-raster;image/svg+xml;image/svg+xml-compressed;image/x-webp;
# SYNC: Run kolourpaint --mimetypes
MimeType=application/x-krita;application/x-navi-animation;image/avif;image/avif-sequence;image/bmp;image/gif;image/heif;image/jpeg;image/openraster;image/png;image/svg+xml;image/svg+xml-compressed;image/tiff;image/vnd.adobe.photoshop;image/vnd.microsoft.icon;image/vnd.wap.wbmp;image/webp;image/x-eps;image/x-exr;image/x-hdr;image/x-icns;image/x-mng;image/x-pcx;image/x-pic;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-rgb;image/x-sun-raster;image/x-tga;image/x-xbitmap;image/x-xcf;image/x-xpixmap;
Categories=Qt;KDE;Graphics;2DGraphics;RasterGraphics;
Terminal=false
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment