summaryrefslogtreecommitdiffstats
path: root/src/webengine
diff options
context:
space:
mode:
Diffstat (limited to 'src/webengine')
-rw-r--r--src/webengine/api/qquickwebenginehistory.cpp6
-rw-r--r--src/webengine/api/qquickwebenginehistory_p.h3
-rw-r--r--src/webengine/api/qquickwebengineview.cpp10
-rw-r--r--src/webengine/api/qquickwebengineview_p_p.h2
4 files changed, 10 insertions, 11 deletions
diff --git a/src/webengine/api/qquickwebenginehistory.cpp b/src/webengine/api/qquickwebenginehistory.cpp
index 184b7079..07ab7810 100644
--- a/src/webengine/api/qquickwebenginehistory.cpp
+++ b/src/webengine/api/qquickwebenginehistory.cpp
@@ -178,13 +178,9 @@ QQuickWebEngineHistoryListModel *QQuickWebEngineHistory::forwardItems() const
return d->m_forwardNavigationModel.data();
}
-void QQuickWebEngineHistory::reset(QQuickWebEngineLoadRequest *loadRequest)
+void QQuickWebEngineHistory::reset()
{
Q_D(QQuickWebEngineHistory);
-
- if (loadRequest->status() != QQuickWebEngineView::LoadSucceededStatus)
- return;
-
d->m_backNavigationModel->reset();
d->m_forwardNavigationModel->reset();
}
diff --git a/src/webengine/api/qquickwebenginehistory_p.h b/src/webengine/api/qquickwebenginehistory_p.h
index 729f7070..4364b377 100644
--- a/src/webengine/api/qquickwebenginehistory_p.h
+++ b/src/webengine/api/qquickwebenginehistory_p.h
@@ -97,8 +97,7 @@ public:
QQuickWebEngineHistoryListModel *backItems() const;
QQuickWebEngineHistoryListModel *forwardItems() const;
-public Q_SLOTS:
- void reset(QQuickWebEngineLoadRequest*);
+ void reset();
private:
QQuickWebEngineHistory();
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index f9a47a61..ac19de15 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -260,13 +260,20 @@ qreal QQuickWebEngineViewPrivate::dpiScale() const
void QQuickWebEngineViewPrivate::loadStarted(const QUrl &provisionalUrl)
{
Q_Q(QQuickWebEngineView);
+ m_history->reset();
QQuickWebEngineLoadRequest loadRequest(provisionalUrl, QQuickWebEngineView::LoadStartedStatus);
Q_EMIT q->loadingChanged(&loadRequest);
}
+void QQuickWebEngineViewPrivate::loadCommitted()
+{
+ m_history->reset();
+}
+
void QQuickWebEngineViewPrivate::loadFinished(bool success, int error_code, const QString &error_description)
{
Q_Q(QQuickWebEngineView);
+ m_history->reset();
if (error_code == WebEngineError::UserAbortedError) {
QQuickWebEngineLoadRequest loadRequest(q->url(), QQuickWebEngineView::LoadStoppedStatus);
Q_EMIT q->loadingChanged(&loadRequest);
@@ -382,9 +389,6 @@ QQuickWebEngineView::QQuickWebEngineView(QQuickItem *parent)
Q_D(QQuickWebEngineView);
d->e->q_ptr = this;
d->adapter->initialize(d);
-
- QObject::connect(this, &QQuickWebEngineView::loadingChanged, d->m_history.data(), &QQuickWebEngineHistory::reset);
-
this->setFocus(true);
this->setActiveFocusOnTab(true);
this->setFlag(QQuickItem::ItemIsFocusScope);
diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h
index 9a7736d1..be5318af 100644
--- a/src/webengine/api/qquickwebengineview_p_p.h
+++ b/src/webengine/api/qquickwebengineview_p_p.h
@@ -135,7 +135,7 @@ public:
virtual QRectF viewportRect() const Q_DECL_OVERRIDE;
virtual qreal dpiScale() const Q_DECL_OVERRIDE;
virtual void loadStarted(const QUrl &provisionalUrl) Q_DECL_OVERRIDE;
- virtual void loadCommitted() Q_DECL_OVERRIDE { }
+ virtual void loadCommitted() Q_DECL_OVERRIDE;
virtual void loadFinished(bool success, int error_code = 0, const QString &error_description = QString()) Q_DECL_OVERRIDE;
virtual void focusContainer() Q_DECL_OVERRIDE;
virtual void adoptNewWindow(WebContentsAdapter *newWebContents, WindowOpenDisposition disposition, const QRect &) Q_DECL_OVERRIDE;