From e263572e56f7a17bf1b003ee282a96426d41cb84 Mon Sep 17 00:00:00 2001 From: nowrep Date: Sat, 15 Oct 2011 18:08:52 +0200 Subject: [PATCH] Fixed updating url in locationbar when browsing through history back and forward --- src/adblock/adblockicon.cpp | 2 +- src/webview/tabwidget.cpp | 2 -- src/webview/webtab.cpp | 2 +- src/webview/webview.cpp | 22 +++++++--------------- 4 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/adblock/adblockicon.cpp b/src/adblock/adblockicon.cpp index 5c13d12ee..26a9dfe17 100644 --- a/src/adblock/adblockicon.cpp +++ b/src/adblock/adblockicon.cpp @@ -20,7 +20,7 @@ #include "qupzilla.h" #include "webpage.h" -AdBlockIcon::AdBlockIcon(QupZilla *mainClass, QWidget *parent) +AdBlockIcon::AdBlockIcon(QupZilla* mainClass, QWidget* parent) : ClickableLabel(parent) , p_QupZilla(mainClass) { diff --git a/src/webview/tabwidget.cpp b/src/webview/tabwidget.cpp index f74289aa0..a82f31df5 100644 --- a/src/webview/tabwidget.cpp +++ b/src/webview/tabwidget.cpp @@ -237,8 +237,6 @@ int TabWidget::addView(QUrl url, const QString &title, OpenUrlIn openIn, bool se tabBar()->setTabsClosable(false); else tabBar()->setTabsClosable(true); -// connect(weView(index), SIGNAL(siteIconChanged()), p_QupZilla->locationBar(), SLOT(siteIconChanged())); -// connect(weView(index), SIGNAL(showUrl(QUrl)), p_QupZilla->locationBar(), SLOT(showUrl(QUrl))); connect(webView, SIGNAL(wantsCloseTab(int)), this, SLOT(closeTab(int))); connect(webView, SIGNAL(changed()), mApp, SLOT(setStateChanged())); connect(webView, SIGNAL(ipChanged(QString)), p_QupZilla->ipLabel(), SLOT(setText(QString))); diff --git a/src/webview/webtab.cpp b/src/webview/webtab.cpp index b1d81b6a1..e4f7d5388 100644 --- a/src/webview/webtab.cpp +++ b/src/webview/webtab.cpp @@ -45,7 +45,7 @@ WebTab::WebTab(QupZilla* mainClass, LocationBar* locationBar) connect(m_view, SIGNAL(iconChanged()), m_locationBar, SLOT(siteIconChanged())); connect(m_view, SIGNAL(loadStarted()), m_locationBar, SLOT(clearIcon())); connect(m_view, SIGNAL(loadFinished(bool)), m_locationBar, SLOT(siteIconChanged())); - connect(m_view, SIGNAL(urlChanged(QUrl)), m_locationBar, SLOT(showUrl(QUrl))); + connect(m_view, SIGNAL(showUrl(QUrl)), m_locationBar, SLOT(showUrl(QUrl))); connect(m_view, SIGNAL(rssChanged(bool)), m_locationBar, SLOT(showRSSIcon(bool))); connect(m_view->webPage(), SIGNAL(privacyChanged(bool)), m_locationBar, SLOT(setPrivacy(bool))); } diff --git a/src/webview/webview.cpp b/src/webview/webview.cpp index 23f3ae326..94b90fd96 100644 --- a/src/webview/webview.cpp +++ b/src/webview/webview.cpp @@ -118,12 +118,13 @@ bool WebView::isCurrent() void WebView::urlChanged(const QUrl &url) { - if (isCurrent()) { - emit showUrl(url); + if (isCurrent()) p_QupZilla->navigationBar()->refreshHistory(); - } + if (m_lastUrl != url) emit changed(); + + emit showUrl(url); } void WebView::linkClicked(const QUrl &url) @@ -134,9 +135,6 @@ void WebView::linkClicked(const QUrl &url) void WebView::setProgress(int prog) { m_progress = prog; - if (isCurrent()) { - emit showUrl(url()); - } checkRss(); if (isCurrent()) { @@ -156,10 +154,6 @@ void WebView::loadStarted() if (title().isNull()) tabWidget()->setTabText(tabIndex(),tr("Loading...")); - if (isCurrent()) { - emit showUrl(url()); - } - m_currentIp.clear(); // if (m_loadingTimer) @@ -216,18 +210,16 @@ void WebView::setIp(const QHostInfo &info) void WebView::loadFinished(bool state) { Q_UNUSED(state); - if (!animationLoading(tabIndex(), false)) - return; if (animationLoading(tabIndex(), false)->movie()) animationLoading(tabIndex(), false)->movie()->stop(); m_isLoading = false; - if (m_lastUrl!=url()) + if (m_lastUrl != url()) mApp->history()->addHistoryEntry(this); - if (isCurrent()) - emit showUrl(url()); + + emit showUrl(url()); iconChanged(); m_lastUrl = url();