1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Do not add an item to history only if reloading.

Should fix #666.
This commit is contained in:
Franz Fellner 2012-12-08 21:18:30 +01:00
parent 4e114b69c5
commit 251ab8af66
2 changed files with 5 additions and 1 deletions

View File

@ -54,6 +54,7 @@ WebView::WebView(QWidget* parent)
, m_actionStop(0) , m_actionStop(0)
, m_actionsInitialized(false) , m_actionsInitialized(false)
, m_disableTouchMocking(false) , m_disableTouchMocking(false)
, m_isReloading(false)
{ {
connect(this, SIGNAL(loadStarted()), this, SLOT(slotLoadStarted())); connect(this, SIGNAL(loadStarted()), this, SLOT(slotLoadStarted()));
connect(this, SIGNAL(loadProgress(int)), this, SLOT(slotLoadProgress(int))); connect(this, SIGNAL(loadProgress(int)), this, SLOT(slotLoadProgress(int)));
@ -294,6 +295,7 @@ void WebView::zoomReset()
void WebView::reload() void WebView::reload()
{ {
m_isReloading = true;
if (QWebView::url().isEmpty() && !m_aboutToLoadUrl.isEmpty()) { if (QWebView::url().isEmpty() && !m_aboutToLoadUrl.isEmpty()) {
load(m_aboutToLoadUrl); load(m_aboutToLoadUrl);
return; return;
@ -357,12 +359,13 @@ void WebView::slotLoadFinished()
m_actionReload->setEnabled(true); m_actionReload->setEnabled(true);
} }
if (m_lastUrl != url()) { if (!m_isReloading) {
mApp->history()->addHistoryEntry(this); mApp->history()->addHistoryEntry(this);
} }
mApp->autoFill()->completePage(page()); mApp->autoFill()->completePage(page());
m_isReloading = false;
m_lastUrl = url(); m_lastUrl = url();
} }

View File

@ -169,6 +169,7 @@ private:
bool m_actionsInitialized; bool m_actionsInitialized;
bool m_disableTouchMocking; bool m_disableTouchMocking;
bool m_isReloading;
}; };
#endif // WEBVIEW_H #endif // WEBVIEW_H