diff --git a/articleview.cc b/articleview.cc index 2541643b..e41c5b6a 100644 --- a/articleview.cc +++ b/articleview.cc @@ -518,7 +518,7 @@ void ArticleView::loadFinished( bool ) { setZoomFactor(cfg.preferences.zoomFactor); QUrl url = ui.definition->url(); - qDebug() << "article view loaded url:" << url; + qDebug() << "article view loaded url:" << url.url ().left (200); QVariant userDataVariant = ui.definition->property("currentArticle"); diff --git a/resourceschemehandler.cpp b/resourceschemehandler.cpp index 40cdcb3f..fa266dcb 100644 --- a/resourceschemehandler.cpp +++ b/resourceschemehandler.cpp @@ -8,16 +8,18 @@ void ResourceSchemeHandler::requestStarted(QWebEngineUrlRequestJob *requestJob) QUrl url = requestJob->requestUrl(); QNetworkRequest request; - request.setUrl( url ); - + request.setUrl(url); QNetworkReply *reply = this->mManager.createRequest(QNetworkAccessManager::GetOperation, request, NULL); - connect(reply, &QNetworkReply::finished, requestJob, [=]() { if (reply->error() == QNetworkReply::ContentNotFoundError) { requestJob->fail(QWebEngineUrlRequestJob::UrlNotFound); return; } - qDebug() << "resource scheme handler receive finished signal:" << reply->request().url(); + if (reply->error() != QNetworkReply::NoError) { + qDebug() << "resource handler failed:" << reply->error() << ":" << reply->request().url(); + requestJob->fail(QWebEngineUrlRequestJob::RequestFailed); + return; + } QMimeType mineType = db.mimeTypeForUrl(url); QString contentType = mineType.name(); // Reply segment