Commit a5b00c96 authored by Jonathan Marten's avatar Jonathan Marten Committed by Stefano Crocco
Browse files

Honour the "--part" command line argument

Bisection shows that the argument is ignored since commit e095b38d,
the porting of KonqRun to UrlLoader.  If set, use it to find the
service for the part in UrlLoader::decideEmbedOrSave().

Test cases:
without patch konqueror --part khtml kde.org --> displays in WebEngine
with this patch --> displays in KHTML
parent a65ec89a
Pipeline #166994 passed with stage
in 6 minutes and 36 seconds
......@@ -174,7 +174,14 @@ bool UrlLoader::decideEmbedOrSave()
if (m_view && m_request.typedUrl.isEmpty() && m_view->supportsMimeType(m_mimeType)) {
m_service = m_view->service();
} else {
m_service = KMimeTypeTrader::self()->preferredService(m_mimeType, QStringLiteral("KParts/ReadOnlyPart"));
if (!m_request.serviceName.isEmpty()) {
// If the service name has been set by the "--part" command line argument
// (detected in handleCommandLine() in konqmain.cpp), then use it as is.
m_service = KService::serviceByStorageId(m_request.serviceName);
} else {
// Otherwise, use the preferred service for the MIME type.
m_service = KMimeTypeTrader::self()->preferredService(m_mimeType, QStringLiteral("KParts/ReadOnlyPart"));
}
}
}
......
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