Commit 6cbdc0b4 authored by Laurent Montel's avatar Laurent Montel 😁

Minor optimization

parent d978e974
......@@ -138,15 +138,15 @@ void ArticleViewerWebEngineWidgetNg::slotPrintPreview()
void ArticleViewerWebEngineWidgetNg::slotOpenInBrowser()
{
if (mArticleViewerNg->url().isLocalFile()) {
const QUrl currentUrl(mArticleViewerNg->url());
if (currentUrl.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);
KRun::runUrl(currentUrl, QStringLiteral("text/html"), this);
}
}
......
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