Web: [skip ci] when dropping local file on StartPage then open it instead of downloading it
This commit is contained in:
@@ -568,7 +568,15 @@ bool BrowserView::chckHostAllowed(const QString& host)
|
||||
#ifdef QTWEBENGINE
|
||||
void BrowserView::onDownloadRequested(QWebEngineDownloadItem *request)
|
||||
{
|
||||
Gui::Dialog::DownloadManager::getInstance()->download(request->url());
|
||||
QUrl url = request->url();
|
||||
if (!url.isLocalFile()) {
|
||||
request->accept();
|
||||
Gui::Dialog::DownloadManager::getInstance()->download(request->url());
|
||||
}
|
||||
else {
|
||||
request->cancel();
|
||||
Gui::getMainWindow()->loadUrls(App::GetApplication().getActiveDocument(), QList<QUrl>() << url);
|
||||
}
|
||||
}
|
||||
|
||||
void BrowserView::setWindowIcon(const QIcon &icon)
|
||||
@@ -598,7 +606,13 @@ void BrowserView::onViewSource(const QUrl &url)
|
||||
#else
|
||||
void BrowserView::onDownloadRequested(const QNetworkRequest & request)
|
||||
{
|
||||
Gui::Dialog::DownloadManager::getInstance()->download(request);
|
||||
QUrl url = request.url();
|
||||
if (!url.isLocalFile()) {
|
||||
Gui::Dialog::DownloadManager::getInstance()->download(request);
|
||||
}
|
||||
else {
|
||||
Gui::getMainWindow()->loadUrls(App::GetApplication().getActiveDocument(), QList<QUrl>() << url);
|
||||
}
|
||||
}
|
||||
|
||||
void BrowserView::onUnsupportedContent(QNetworkReply* reply)
|
||||
|
||||
Reference in New Issue
Block a user