Changeset View
Changeset View
Standalone View
Standalone View
webenginepart/src/webenginepage.cpp
Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Line(s) | 87 | // this, SLOT(slotUnsupportedContent(QNetworkReply*))); | |||
---|---|---|---|---|---|
90 | connect(this, &QWebEnginePage::loadFinished, | 90 | connect(this, &QWebEnginePage::loadFinished, | ||
91 | this, &WebEnginePage::slotLoadFinished); | 91 | this, &WebEnginePage::slotLoadFinished); | ||
92 | connect(this, &QWebEnginePage::authenticationRequired, | 92 | connect(this, &QWebEnginePage::authenticationRequired, | ||
93 | this, &WebEnginePage::slotAuthenticationRequired); | 93 | this, &WebEnginePage::slotAuthenticationRequired); | ||
94 | if(!this->profile()->httpUserAgent().contains(QLatin1String("Konqueror"))) | 94 | if(!this->profile()->httpUserAgent().contains(QLatin1String("Konqueror"))) | ||
95 | { | 95 | { | ||
96 | this->profile()->setHttpUserAgent(this->profile()->httpUserAgent() + " Konqueror (WebEnginePart)"); | 96 | this->profile()->setHttpUserAgent(this->profile()->httpUserAgent() + " Konqueror (WebEnginePart)"); | ||
97 | } | 97 | } | ||
98 | | ||||
98 | WebEnginePartDownloadManager::instance()->addPage(this); | 99 | WebEnginePartDownloadManager::instance()->addPage(this); | ||
100 | | ||||
99 | m_wallet = new WebEngineWallet(this, parent ? parent->window()->winId() : 0); | 101 | m_wallet = new WebEngineWallet(this, parent ? parent->window()->winId() : 0); | ||
100 | } | 102 | } | ||
101 | 103 | | |||
102 | WebEnginePage::~WebEnginePage() | 104 | WebEnginePage::~WebEnginePage() | ||
103 | { | 105 | { | ||
104 | //kDebug() << this; | 106 | //kDebug() << this; | ||
105 | } | 107 | } | ||
106 | 108 | | |||
▲ Show 20 Lines • Show All 153 Lines • ▼ Show 20 Line(s) | 259 | if (inPageRequest) { | |||
260 | 262 | | |||
261 | // if (m_sslInfo.isValid()) | 263 | // if (m_sslInfo.isValid()) | ||
262 | // setRequestMetaData(QL1S("ssl_was_in_use"), QL1S("TRUE")); | 264 | // setRequestMetaData(QL1S("ssl_was_in_use"), QL1S("TRUE")); | ||
263 | } | 265 | } | ||
264 | 266 | | |||
265 | 267 | | |||
266 | // Honor the enabling/disabling of plugins per host. | 268 | // Honor the enabling/disabling of plugins per host. | ||
267 | settings()->setAttribute(QWebEngineSettings::PluginsEnabled, WebEngineSettings::self()->isPluginsEnabled(reqUrl.host())); | 269 | settings()->setAttribute(QWebEngineSettings::PluginsEnabled, WebEngineSettings::self()->isPluginsEnabled(reqUrl.host())); | ||
270 | #ifndef DOWNLOADITEM_KNOWS_PAGE | ||||
268 | emit navigationRequested(this, url); | 271 | emit navigationRequested(this, url); | ||
272 | #endif | ||||
269 | return QWebEnginePage::acceptNavigationRequest(url, type, isMainFrame); | 273 | return QWebEnginePage::acceptNavigationRequest(url, type, isMainFrame); | ||
270 | } | 274 | } | ||
271 | 275 | | |||
272 | #if 0 | 276 | #if 0 | ||
273 | static int errorCodeFromReply(QNetworkReply* reply) | 277 | static int errorCodeFromReply(QNetworkReply* reply) | ||
274 | { | 278 | { | ||
275 | // First check if there is a KIO error code sent back and use that, | 279 | // First check if there is a KIO error code sent back and use that, | ||
276 | // if not attempt to convert QNetworkReply's NetworkError to KIO::Error. | 280 | // if not attempt to convert QNetworkReply's NetworkError to KIO::Error. | ||
▲ Show 20 Lines • Show All 565 Lines • ▼ Show 20 Line(s) | 771 | if (m_createNewWindow) { | |||
842 | // Set the new part as the one this page will use going forward. | 846 | // Set the new part as the one this page will use going forward. | ||
843 | setPart(webenginePart); | 847 | setPart(webenginePart); | ||
844 | // Connect all the signals from this page to the slots in the new part. | 848 | // Connect all the signals from this page to the slots in the new part. | ||
845 | webenginePart->connectWebEnginePageSignals(this); | 849 | webenginePart->connectWebEnginePageSignals(this); | ||
846 | //Set the create new window flag to false... | 850 | //Set the create new window flag to false... | ||
847 | m_createNewWindow = false; | 851 | m_createNewWindow = false; | ||
848 | 852 | | |||
849 | } | 853 | } | ||
854 | | ||||
855 | #ifndef DOWNLOADITEM_KNOWS_PAGE | ||||
850 | emit navigationRequested(this, url); | 856 | emit navigationRequested(this, url); | ||
857 | #endif | ||||
851 | return WebEnginePage::acceptNavigationRequest(url, type, isMainFrame); | 858 | return WebEnginePage::acceptNavigationRequest(url, type, isMainFrame); | ||
852 | } | 859 | } | ||
853 | 860 | | |||
854 | void NewWindowPage::slotGeometryChangeRequested(const QRect & rect) | 861 | void NewWindowPage::slotGeometryChangeRequested(const QRect & rect) | ||
855 | { | 862 | { | ||
856 | if (!rect.isValid()) | 863 | if (!rect.isValid()) | ||
857 | return; | 864 | return; | ||
858 | 865 | | |||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |