From d2b1a62a0ecdd286b9d83275170a3322ffafd32c Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 12 Apr 2010 02:00:13 +0200 Subject: URLBAR ANIMATION: implementation fix This commit follows the logic explained somewhere else, moving rekonq to a better management for urls from user input. 1) users type strings --> we store them in QStrings 2) app load urls --> we should ever work with KUrls, trying to guess users needs Here I also removed the unuseful QString icon from UrlSearchItem definition, as we just have a type (Search, Browse, History, Books..), a (k)url and an Application::icon method :) --- src/urlbar/urlbar.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/urlbar/urlbar.cpp') diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index 6f916482..3b79b06b 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -73,7 +73,7 @@ UrlBar::UrlBar(QWidget *parent) // suggestions installEventFilter(_box); - connect(_box, SIGNAL(chosenUrl(const QString&, Rekonq::OpenType)), SLOT(activated(const QString&, Rekonq::OpenType))); + connect(_box, SIGNAL(chosenUrl(const KUrl &, Rekonq::OpenType)), SLOT(activated(const KUrl &, Rekonq::OpenType))); } @@ -103,16 +103,13 @@ void UrlBar::setQUrl(const QUrl& url) } -void UrlBar::activated(const QString& urlString, Rekonq::OpenType type) +void UrlBar::activated(const KUrl& url, Rekonq::OpenType type) { disconnect(this, SIGNAL(textChanged(const QString &)), this, SLOT(suggestUrls(const QString &))); - if (urlString.isEmpty()) - return; - clearFocus(); - setText(urlString); - Application::instance()->loadUrl(urlString.trimmed(), type); + setUrl(url); + Application::instance()->loadUrl(url, type); } -- cgit v1.2.1