goldendict-ng/gico_schemahandler.cpp

20 lines
592 B
C++

#include "gico_schemahandler.h"
GicoSchemeHandler::GicoSchemeHandler(ArticleNetworkAccessManager& articleNetMgr):mManager(articleNetMgr){
}
void GicoSchemeHandler::requestStarted(QWebEngineUrlRequestJob *requestJob)
{
QUrl url = requestJob->requestUrl();
QNetworkRequest request;
request.setUrl( url );
QNetworkReply* reply=this->mManager.createRequest(QNetworkAccessManager::GetOperation,request,NULL);
QMimeType mineType=db.mimeTypeForUrl (url);
QString contentType=mineType.name ();
// Reply segment
requestJob->reply(contentType.toLatin1(), reply);
}