diff options
author | Pierre Rossi <pierre.rossi@digia.com> | 2014-08-21 14:02:10 +0200 |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-09-02 23:55:38 +0200 |
commit | ede95c2a1186c17996091950ec57c5998f73fa7a (patch) | |
tree | 96703d5c7c5968d775517ca249123c97890873eb /src/webenginewidgets/api/qwebenginepage.cpp | |
parent | ce7797dadce021c7da5d18a9b945100ae08c8224 (diff) |
Don't forward loading of error pages to the API layer
The fact that the error pages are HTML and get loaded through the
same mechanism should be kept an implementation detail and not be
considered as a new load in the API sense.
Also implement HasErrorPage for good measure and remove an anoying
warning from the demo browser.
The issue of the url not being changed remains in the QML test (but
it doesn't affect a typical browser-like UI since the user input is
still there untouched in the address bar), just make sure that failure
does not affect the later checks. It also seems like we have a focus
problem somehow, but the test should probably use a click for that
matter.
Change-Id: Ib5e363981a11287fdf4bfe84b93c999d96ed8087
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'src/webenginewidgets/api/qwebenginepage.cpp')
-rw-r--r-- | src/webenginewidgets/api/qwebenginepage.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index 51e733e70..ac677a8c6 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -171,6 +171,7 @@ QWebEnginePagePrivate::QWebEnginePagePrivate() , history(new QWebEngineHistory(new QWebEngineHistoryPrivate(this))) , settings(new QWebEngineSettings) , view(0) + , isLoading(false) { memset(actions, 0, sizeof(actions)); } @@ -237,6 +238,7 @@ void QWebEnginePagePrivate::loadStarted(const QUrl &provisionalUrl) { Q_UNUSED(provisionalUrl) Q_Q(QWebEnginePage); + isLoading = true; Q_EMIT q->loadStarted(); updateNavigationActions(); } @@ -251,6 +253,7 @@ void QWebEnginePagePrivate::loadFinished(bool success, int error_code, const QSt Q_Q(QWebEnginePage); Q_UNUSED(error_code); Q_UNUSED(error_description); + isLoading = false; if (success) m_explicitUrl = QUrl(); Q_EMIT q->loadFinished(success); @@ -362,11 +365,11 @@ void QWebEnginePagePrivate::updateAction(QWebEnginePage::WebAction action) const enabled = adapter->canGoForward(); break; case QWebEnginePage::Stop: - enabled = adapter->isLoading(); + enabled = isLoading; break; case QWebEnginePage::Reload: case QWebEnginePage::ReloadAndBypassCache: - enabled = !adapter->isLoading(); + enabled = !isLoading; break; default: break; |