Commit d978e974 authored by Laurent Montel's avatar Laurent Montel 😁

Use real url when possible

parent fba943db
......@@ -138,11 +138,16 @@ void ArticleViewerWebEngineWidgetNg::slotPrintPreview()
void ArticleViewerWebEngineWidgetNg::slotOpenInBrowser()
{
WebEngineViewer::WebEngineExportHtmlPageJob *job = new WebEngineViewer::WebEngineExportHtmlPageJob;
job->setEngineView(mArticleViewerNg);
connect(job, &WebEngineViewer::WebEngineExportHtmlPageJob::failed, this, &ArticleViewerWebEngineWidgetNg::slotExportHtmlPageFailed);
connect(job, &WebEngineViewer::WebEngineExportHtmlPageJob::success, this, &ArticleViewerWebEngineWidgetNg::slotExportHtmlPageSuccess);
job->start();
if (mArticleViewerNg->url().isLocalFile()) {
WebEngineViewer::WebEngineExportHtmlPageJob *job = new WebEngineViewer::WebEngineExportHtmlPageJob;
job->setEngineView(mArticleViewerNg);
connect(job, &WebEngineViewer::WebEngineExportHtmlPageJob::failed, this, &ArticleViewerWebEngineWidgetNg::slotExportHtmlPageFailed);
connect(job, &WebEngineViewer::WebEngineExportHtmlPageJob::success, this, &ArticleViewerWebEngineWidgetNg::slotExportHtmlPageSuccess);
job->start();
} else {
const QUrl url(mArticleViewerNg->url());
KRun::runUrl(url, QStringLiteral("text/html"), this);
}
}
void ArticleViewerWebEngineWidgetNg::slotExportHtmlPageFailed()
......
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