Commit 8bfa7cde authored by Stefano Crocco's avatar Stefano Crocco Committed by David Faure
Browse files

Add support to display web archives file in WebEnginePart

parent ea0ee5c3
......@@ -90,7 +90,7 @@ void WebEnginePart::initWebEngineUrlSchemes()
static bool needToInitUrlSchemes = true;
if (needToInitUrlSchemes) {
needToInitUrlSchemes = false;
QVector<QByteArray> localSchemes = {"error", "konq"};
QVector<QByteArray> localSchemes = {"error", "konq", "tar"};
const QStringList protocols = KProtocolInfo::protocols();
for(const QString &prot : protocols){
if (KProtocolInfo::defaultMimetype(prot) == "text/html") {
......@@ -123,6 +123,7 @@ WebEnginePart::WebEnginePart(QWidget *parentWidget, QObject *parent,
prof->installUrlSchemeHandler("error", new WebEnginePartErrorSchemeHandler(prof));
prof->installUrlSchemeHandler("konq", new KonqUrlSchemeHandler(prof));
prof->installUrlSchemeHandler("help", new WebEnginePartKIOHandler(prof));
prof->installUrlSchemeHandler("tar", new WebEnginePartKIOHandler(prof));
}
static WebEnginePartCookieJar s_cookieJar(prof, nullptr);
KAboutData about = KAboutData(QStringLiteral("webenginepart"),
......
......@@ -89,6 +89,6 @@ void WebEnginePartKIOHandler::kioJobFinished(KIO::StoredTransferJob* job)
m_error = job->error() == 0 ? QWebEngineUrlRequestJob::NoError : QWebEngineUrlRequestJob::RequestFailed;
m_errorMessage = isSuccessful() ? job->errorString() : QString();
m_data = job->data();
m_mimeType = QMimeDatabase().mimeTypeForData(m_data);
m_mimeType = QMimeDatabase().mimeTypeForName(job->mimetype());
processSlaveOutput();
}
Markdown is supported
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