summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-10-15 16:37:05 (GMT)
committerMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-10-15 16:37:05 (GMT)
commit92a44490bd3d2b6ff892a4df1729022017e41c02 (patch)
tree3348bc71b7b3b55e04ec95ad33ee202a687c40ab
parent3068071069c8384151c7831b608dc1805ff1a5ff (diff)
Port away from KMimeType
-rw-r--r--lib/archiveutils.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/archiveutils.cpp b/lib/archiveutils.cpp
index 120a4eb..4a498ab 100644
--- a/lib/archiveutils.cpp
+++ b/lib/archiveutils.cpp
@@ -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;
}
}
}