Commit cc1dced4 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

KAlarm: port away from KMimeType

parent 92eb2317
......@@ -1604,15 +1604,15 @@ void writeConfigWindowSize(const char* window, const QSize& size, int splitterWi
* If a text file, its type is distinguished.
* Reply = file type.
*/
FileType fileType(const KMimeType::Ptr& mimetype)
FileType fileType(const QMimeType& mimetype)
{
if (mimetype->is(QStringLiteral("text/html")))
if (mimetype.inherits(QStringLiteral("text/html")))
return TextFormatted;
if (mimetype->is(QStringLiteral("application/x-executable")))
if (mimetype.inherits(QStringLiteral("application/x-executable")))
return TextApplication;
if (mimetype->is(QStringLiteral("text/plain")))
if (mimetype.inherits(QStringLiteral("text/plain")))
return TextPlain;
if (mimetype->name().startsWith(QStringLiteral("image/")))
if (mimetype.name().startsWith(QLatin1String("image/")))
return Image;
return Unknown;
}
......
......@@ -30,12 +30,12 @@
#include <AkonadiCore/collection.h>
#include <AkonadiCore/item.h>
#include <kfile.h>
#include <kmimetype.h>
#include <KUrl>
#include <QSize>
#include <QString>
#include <QVector>
#include <QMimeType>
using namespace KAlarmCal;
......@@ -90,7 +90,7 @@ void writeConfigWindowSize(const char* window, const QSize&, int
/** Check from its mime type whether a file appears to be a text or image file.
* If a text file, its type is distinguished.
*/
FileType fileType(const KMimeType::Ptr& mimetype);
FileType fileType(const QMimeType& mimetype);
/** Check that a file exists and is a plain readable file, optionally a text/image file.
* Display a Continue/Cancel error message if 'errmsgParent' non-null.
*/
......
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