From 7570ac569271753a5956b50de4fb3f950376eca2 Mon Sep 17 00:00:00 2001 From: Yoann Laissus Date: Wed, 20 Oct 2010 09:29:14 +0200 Subject: Fix icons duplication in the urlbar if a bookmark is added during a page loading --- src/mainview.cpp | 6 +----- src/tabbar.cpp | 2 +- src/urlbar/urlbar.cpp | 7 +++++-- src/webtab.cpp | 6 ++++++ src/webtab.h | 1 + 5 files changed, 14 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/mainview.cpp b/src/mainview.cpp index d263111a..4ccbe937 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -284,11 +284,7 @@ void MainView::currentChanged(int index) emit showStatusBarMessage(QString()); // notify UI to eventually switch stop/reload button - int progr = tab->progress(); - if (progr == 0) - emit browserTabLoading(false); - else - emit browserTabLoading(true); + emit browserTabLoading(tab->isPageLoading()); // set focus to the current webview if (tab->url().scheme() == QL1S("about")) diff --git a/src/tabbar.cpp b/src/tabbar.cpp index 1756c20e..0866bfd8 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -166,7 +166,7 @@ void TabBar::showTabPreview() return; // no previews during load - if (indexedTab->progress() != 0) + if (indexedTab->isPageLoading()) return; int w = tabSizeHint(m_currentTabPreviewIndex).width(); diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index 4039e8bf..3ec0b2fa 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -369,8 +369,11 @@ void UrlBar::showBookmarkInfo(const QPoint &pos) void UrlBar::onBookmarksChanged() { - clearRightIcons(); - loadFinished(); + if (!_tab->isPageLoading()) + { + clearRightIcons(); + loadFinished(); + } } diff --git a/src/webtab.cpp b/src/webtab.cpp index 3b97e2db..2289726c 100644 --- a/src/webtab.cpp +++ b/src/webtab.cpp @@ -123,6 +123,12 @@ void WebTab::loadFinished(bool) } +bool WebTab::isPageLoading() +{ + return _progress != 0; +} + + void WebTab::createWalletBar(const QString &key, const QUrl &url) { // check if the url is in the wallet blacklist diff --git a/src/webtab.h b/src/webtab.h index 66eec447..3fd4f793 100644 --- a/src/webtab.h +++ b/src/webtab.h @@ -63,6 +63,7 @@ public: void insertBar(NotificationBar* bar); bool hasRSSInfo(); + bool isPageLoading(); private slots: void updateProgress(int progress); -- cgit v1.2.1