Commit 92a44490 authored by Martin Tobias Holmedahl Sandsmark's avatar Martin Tobias Holmedahl Sandsmark
Browse files

Port away from KMimeType

parent 30680710
......@@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// KDE
#include <QDebug>
#include <KFileItem>
#include <KMimeType>
#include <QMimeDatabase>
#include <KProtocolManager>
namespace Gwenview
......@@ -67,13 +67,11 @@ QString protocolForMimeType(const QString& mimeType)
if (protocol.isEmpty()) {
// No protocol, try with mimeType parents. This is useful for .cbz for
// example
KMimeType::Ptr ptr = KMimeType::mimeType(mimeType);
if (ptr) {
Q_FOREACH(const QString & parentMimeType, ptr->allParentMimeTypes()) {
protocol = KProtocolManager::protocolForArchiveMimetype(parentMimeType);
if (!protocol.isEmpty()) {
break;
}
QMimeType mime = QMimeDatabase().mimeTypeForName(mimeType);
for(const QString & parentMimeType : mime.allAncestors()) {
protocol = KProtocolManager::protocolForArchiveMimetype(parentMimeType);
if (!protocol.isEmpty()) {
break;
}
}
}
......
Supports Markdown
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