From c05b14ad0f8358171f4dc199e61dc0a259d0aa65 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 14 Apr 2010 11:59:43 +0200 Subject: Proper solutions are always the best ones :) Fix duplicated right icons. CCBUG: 234320 --- src/protocolhandler.cpp | 2 -- src/urlbar/lineedit.h | 7 ++++--- src/urlbar/urlbar.cpp | 6 ++---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/protocolhandler.cpp b/src/protocolhandler.cpp index 1458bdf5..c97bc475 100644 --- a/src/protocolhandler.cpp +++ b/src/protocolhandler.cpp @@ -146,8 +146,6 @@ bool ProtocolHandler::preHandling(const QNetworkRequest &request, QWebFrame *fra break; } } - - Application::instance()->mainWindow()->mainView()->urlBar()->clearRightIcons(); NewTabPage p(frame); p.generate(_url); diff --git a/src/urlbar/lineedit.h b/src/urlbar/lineedit.h index 5b8ff2a3..68cdc7d1 100644 --- a/src/urlbar/lineedit.h +++ b/src/urlbar/lineedit.h @@ -77,9 +77,7 @@ public: virtual ~LineEdit(); IconButton *iconButton() const; - - void clearRightIcons(); - + protected: virtual void keyPressEvent(QKeyEvent *); virtual void mouseDoubleClickEvent(QMouseEvent *); @@ -88,6 +86,9 @@ protected: IconButton *addRightIcon(LineEdit::icon ); +private slots: + void clearRightIcons(); + private: IconButton *_icon; IconButtonPointerList _rightIconsList; diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index dcdda533..051277e2 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -67,7 +67,8 @@ UrlBar::UrlBar(QWidget *parent) connect(_tab->view(), SIGNAL(urlChanged(const QUrl &)), this, SLOT(setQUrl(const QUrl &))); connect(_tab->view(), SIGNAL(loadFinished(bool)), this, SLOT(loadFinished())); - + connect(_tab->view(), SIGNAL(loadStarted()), this, SLOT(clearRightIcons())); + // suggestions installEventFilter(_box); connect(_box, SIGNAL(chosenUrl(const KUrl &, Rekonq::OpenType)), SLOT(activated(const KUrl &, Rekonq::OpenType))); @@ -83,9 +84,6 @@ UrlBar::~UrlBar() void UrlBar::setQUrl(const QUrl& url) { - // find a better place? Ideally a loadStarted connected slot.. - clearRightIcons(); - if(url.scheme() == QL1S("about") ) { iconButton()->setIcon( KIcon("arrow-right") ); -- cgit v1.2.1