Skip to content
This repository has been archived by the owner on Jul 15, 2021. It is now read-only.

Commit

Permalink
[Fix] Download issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Feldrise committed Jan 6, 2019
1 parent d2d99d8 commit 489c3ce
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions WebEngines/QWebEngine/WebProfile.cpp
Expand Up @@ -32,9 +32,17 @@

namespace Engine {

WebProfile* WebProfile::s_defaultProfile = nullptr;

WebProfile* WebProfile::defaultWebProfile()
{
return static_cast<WebProfile*>(QWebEngineProfile::defaultProfile());
if (!WebProfile::s_defaultProfile) {
WebProfile::s_defaultProfile = static_cast<WebProfile*>(QWebEngineProfile::defaultProfile());

connect(WebProfile::s_defaultProfile, &QWebEngineProfile::downloadRequested, WebProfile::s_defaultProfile, &WebProfile::emitDownloadRequest);
}

return WebProfile::s_defaultProfile;
}

WebProfile::WebProfile(QObject* parent) :
Expand Down Expand Up @@ -72,4 +80,4 @@ void WebProfile::emitDownloadRequest(QWebEngineDownloadItem* download)
emit downloadRequested(new DownloadItem(download));
}

}
}
1 change: 1 addition & 0 deletions WebEngines/QWebEngine/WebProfile.hpp
Expand Up @@ -61,6 +61,7 @@ Q_OBJECT
CookieStore* cookieStore();

static WebProfile* defaultWebProfile();
static WebProfile* s_defaultProfile;

signals:
void downloadRequested(Engine::DownloadItem* item);
Expand Down

0 comments on commit 489c3ce

Please sign in to comment.