Commit 1b122aa4 authored by Stefano Crocco's avatar Stefano Crocco Committed by David Faure
Browse files

Use name instead of storageId in partForLocalFile

parent e095b38d
......@@ -417,7 +417,7 @@ QString UrlLoader::partForLocalFile(const QString& path)
QString mimetype = db.mimeTypeForFile(path).name();
//TODO Remove KonqRun: replace the following two lines with the commented out lines below them as soon as I can find out how to create a service from a KPluginMetaData
KService::Ptr service = KMimeTypeTrader::self()->preferredService(mimetype, QStringLiteral("KParts/ReadOnlyPart"));
return service ? service->storageId() : QString();
return service ? service->name() : QString();
// KPluginMetaData md = KParts::PartLoader::partsForMimeType(mimetype).first();
// return md.pluginId();
}
......
......@@ -242,7 +242,7 @@ bool WebEnginePage::shouldOpenLocalUrl(const QUrl& url) const
QString partToUse;
bool success = success = QMetaObject::invokeMethod(bi, "partForLocalFile", Q_RETURN_ARG(QString, partToUse), Q_ARG(QString, url.path()));
if (success) {
return partToUse == m_part->metaData().pluginId();
return partToUse == m_part->metaData().name();
}
}
return false;
......
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