From 251ab8af66a7bd855e86bef7d1f8ee29cf7e8678 Mon Sep 17 00:00:00 2001 From: Franz Fellner Date: Sat, 8 Dec 2012 21:18:30 +0100 Subject: [PATCH 1/2] Do not add an item to history only if reloading. Should fix #666. --- src/lib/webview/webview.cpp | 5 ++++- src/lib/webview/webview.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/webview/webview.cpp b/src/lib/webview/webview.cpp index a0cfa10c4..8c7168658 100644 --- a/src/lib/webview/webview.cpp +++ b/src/lib/webview/webview.cpp @@ -54,6 +54,7 @@ WebView::WebView(QWidget* parent) , m_actionStop(0) , m_actionsInitialized(false) , m_disableTouchMocking(false) + , m_isReloading(false) { connect(this, SIGNAL(loadStarted()), this, SLOT(slotLoadStarted())); connect(this, SIGNAL(loadProgress(int)), this, SLOT(slotLoadProgress(int))); @@ -294,6 +295,7 @@ void WebView::zoomReset() void WebView::reload() { + m_isReloading = true; if (QWebView::url().isEmpty() && !m_aboutToLoadUrl.isEmpty()) { load(m_aboutToLoadUrl); return; @@ -357,12 +359,13 @@ void WebView::slotLoadFinished() m_actionReload->setEnabled(true); } - if (m_lastUrl != url()) { + if (!m_isReloading) { mApp->history()->addHistoryEntry(this); } mApp->autoFill()->completePage(page()); + m_isReloading = false; m_lastUrl = url(); } diff --git a/src/lib/webview/webview.h b/src/lib/webview/webview.h index 058dd5c4f..2a4044afd 100644 --- a/src/lib/webview/webview.h +++ b/src/lib/webview/webview.h @@ -169,6 +169,7 @@ private: bool m_actionsInitialized; bool m_disableTouchMocking; + bool m_isReloading; }; #endif // WEBVIEW_H From c36e59c31e2e44f2a2bb70848dfe07f6654b03c7 Mon Sep 17 00:00:00 2001 From: Franz Fellner Date: Sun, 9 Dec 2012 08:15:21 +0100 Subject: [PATCH 2/2] Set m_ignoreCurrentChangedSignal to false directly after setCurrentIndex() instead of in currentChanged(). This solves problems for the very first popup not triggering currentChanged(), so in that case the first item did not set the completion url. As long as the connection type to currentChanged() remains a DirectConnection, this fix should work. --- src/lib/navigation/completer/locationcompleter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/navigation/completer/locationcompleter.cpp b/src/lib/navigation/completer/locationcompleter.cpp index bbf74cfe2..d7849e422 100644 --- a/src/lib/navigation/completer/locationcompleter.cpp +++ b/src/lib/navigation/completer/locationcompleter.cpp @@ -65,7 +65,6 @@ void LocationCompleter::showMostVisited() void LocationCompleter::currentChanged(const QModelIndex &index) { if (m_ignoreCurrentChangedSignal) { - m_ignoreCurrentChangedSignal = false; return; } @@ -124,6 +123,7 @@ void LocationCompleter::adjustPopupSize() s_view->resize(s_view->width(), popupHeight); m_ignoreCurrentChangedSignal = true; s_view->setCurrentIndex(QModelIndex()); + m_ignoreCurrentChangedSignal = false; s_view->show(); m_originalText = m_locationBar->text();