Commit 1e9659be authored by Stefano Crocco's avatar Stefano Crocco
Browse files

Set OpenUrlJob ui delegate

parent 95d282ba
......@@ -40,6 +40,7 @@
#include <KIO/JobTracker>
#include <KIO/OpenUrlJob>
#include <KFileUtils>
#include <KIO/JobUiDelegate>
WebEnginePartDownloadManager::WebEnginePartDownloadManager()
: QObject(), m_tempDownloadDir(QDir(QDir::tempPath()).filePath("WebEnginePartDownloadManager"))
......@@ -188,6 +189,8 @@ void WebEnginePartDownloadManager::blobDownloadedToFile(QWebEngineDownloadItem *
page->requestOpenFileAsTemporary(QUrl::fromLocalFile(file), it->mimeType());
} else {
KIO::OpenUrlJob *j = new KIO::OpenUrlJob(QUrl::fromLocalFile(file), it->mimeType(), this);
QWidget *w = page->view();
j->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, w ? w->window() : nullptr));
j->start();
}
}
......
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