diff options
Diffstat (limited to 'src/urlbar')
-rw-r--r-- | src/urlbar/urlbar.cpp | 14 | ||||
-rw-r--r-- | src/urlbar/urlbar.hpp | 7 |
2 files changed, 13 insertions, 8 deletions
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index 18067f09..6c726d5a 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -80,8 +80,13 @@ UrlBar::UrlBar(QWidget *parent) // connect(_suggestionTimer, SIGNAL(timeout()), this, SLOT(suggest())); } +// ----------------------------------------------------------------------------------------------------------- +// slots + void UrlBar::setUrl(const QUrl &url) { + Q_ASSERT(sender() == m_currentView); + if (url.scheme() == QL1S("rekonq")) return; // we don't set empty url @@ -100,9 +105,6 @@ void UrlBar::setUrl(const QUrl &url) setCursorPosition(0); } -// ----------------------------------------------------------------------------------------------------------- -// slots - void UrlBar::loadRequestedUrl(const QUrl &url, rekonq::OpenType type) { clearFocus(); @@ -114,7 +116,7 @@ void UrlBar::loadRequestedUrl(const QUrl &url, rekonq::OpenType type) void UrlBar::loadStarted() { - if (sender() != m_currentView) return; + Q_ASSERT(sender() == m_currentView); m_currentView_progress = 1; _icon->setIcon(QIcon::fromTheme("text-html")); // clearRightIcons(); @@ -124,14 +126,14 @@ void UrlBar::loadStarted() void UrlBar::loadProgress(int progress) { - if (sender() != m_currentView) return; + Q_ASSERT(sender() == m_currentView); m_currentView_progress = progress; repaint(); } void UrlBar::loadFinished() { - if (sender() != m_currentView) return; + Q_ASSERT(sender() == m_currentView); m_currentView_progress = 100; // refreshFavicon(); // updateRightIcons(); diff --git a/src/urlbar/urlbar.hpp b/src/urlbar/urlbar.hpp index 8be97838..3e3b9059 100644 --- a/src/urlbar/urlbar.hpp +++ b/src/urlbar/urlbar.hpp @@ -42,8 +42,11 @@ public slots: void setCurrentView(RekonqView *view) { m_currentView = view; - loadProgress(view->progress()); - setUrl(view->url()); + m_currentView_progress = view->progress(); + + emit view->urlChanged(view->url()); + // setUrl(view->url()); + repaint(); } void setUrl(const QUrl &url); |