You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
2.4 KiB
52 lines
2.4 KiB
9 years ago
|
From c9edc4769d278f174d821cf6d9364fbca356b676 Mon Sep 17 00:00:00 2001
|
||
|
From: David Faure <faure@kde.org>
|
||
|
Date: Sun, 6 Mar 2016 19:35:08 +0100
|
||
|
Subject: [PATCH 9/9] Fix handling of x-scheme-handler/* in mimeapps.list
|
||
|
parsing.
|
||
|
|
||
|
Since this isn't a known mimetype, such lines were being ignored.
|
||
|
|
||
|
BUG: 358159
|
||
|
FIXED-IN: 5.21
|
||
|
---
|
||
|
autotests/CMakeLists.txt | 2 +-
|
||
|
autotests/kmimeassociationstest.cpp | 3 +++
|
||
|
src/sycoca/kmimeassociations.cpp | 7 ++++---
|
||
|
tests/CMakeLists.txt | 2 +-
|
||
|
4 files changed, 9 insertions(+), 5 deletions(-)
|
||
|
|
||
|
diff --git a/src/sycoca/kmimeassociations.cpp b/src/sycoca/kmimeassociations.cpp
|
||
|
index 2ddcc07..25ce3fe 100644
|
||
|
--- a/src/sycoca/kmimeassociations.cpp
|
||
|
+++ b/src/sycoca/kmimeassociations.cpp
|
||
|
@@ -27,6 +27,7 @@
|
||
|
#include <QFile>
|
||
|
#include <qstandardpaths.h>
|
||
|
#include <qmimedatabase.h>
|
||
|
+#include "sycocadebug.h"
|
||
|
|
||
|
KMimeAssociations::KMimeAssociations(KOfferHash &offerHash, KServiceFactory *serviceFactory)
|
||
|
: m_offerHash(offerHash), m_serviceFactory(serviceFactory)
|
||
|
@@ -106,15 +107,15 @@ void KMimeAssociations::parseAddedAssociations(const KConfigGroup &group, const
|
||
|
QMimeDatabase db;
|
||
|
Q_FOREACH (const QString &mimeName, group.keyList()) {
|
||
|
const QStringList services = group.readXdgListEntry(mimeName);
|
||
|
- const QString resolvedMimeName = db.mimeTypeForName(mimeName).name();
|
||
|
+ const QString resolvedMimeName = mimeName.startsWith("x-scheme-handler/") ? mimeName : db.mimeTypeForName(mimeName).name();
|
||
|
if (resolvedMimeName.isEmpty()) {
|
||
|
- //qDebug() << file << "specifies unknown mimeType" << mimeName << "in" << group.name();
|
||
|
+ qCDebug(SYCOCA) << file << "specifies unknown mimeType" << mimeName << "in" << group.name();
|
||
|
} else {
|
||
|
int pref = basePreference;
|
||
|
Q_FOREACH (const QString &service, services) {
|
||
|
KService::Ptr pService = m_serviceFactory->findServiceByStorageId(service);
|
||
|
if (!pService) {
|
||
|
- //qDebug() << file << "specifies unknown service" << service << "in" << group.name();
|
||
|
+ qDebug(SYCOCA) << file << "specifies unknown service" << service << "in" << group.name();
|
||
|
} else {
|
||
|
//qDebug() << "adding mime" << resolvedMimeName << "to service" << pService->entryPath() << "pref=" << pref;
|
||
|
m_offerHash.addServiceOffer(resolvedMimeName, KServiceOffer(pService, pref, 0, pService->allowAsDefault()));
|
||
|
--
|
||
|
2.5.0
|
||
|
|