From f0c11eadaa4b77a4e36130b014b62cd6200c8211 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 28 Aug 2010 19:24:19 +0200 Subject: Switching to "KDE" icon cache. While this "brute force" change can be dangerous, it seems let everything work as expected (at least here). It also lets us to retrieve icons when sites are not visited (eg: search engines or old bookmarks) It also contains fixes & improvements for icons management in History & Bookmarks classes. More code to maintain, but more things working.Let's see what'll happen... --- src/urlbar/urlbar.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/urlbar/urlbar.cpp') diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index 65c0a213..0b966b74 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -43,6 +43,7 @@ #include "completionwidget.h" #include "bookmarkprovider.h" #include "bookmarkwidget.h" +#include "iconmanager.h" // KDE Includes #include @@ -110,7 +111,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())); - + connect(_tab->view(), SIGNAL(iconChanged()), this, SLOT(refreshFavicon())); + // bookmark icon connect(Application::bookmarkProvider()->bookmarkManager(), SIGNAL(changed(const QString &, const QString &)), this, SLOT(onBookmarksChanged())); @@ -145,7 +147,7 @@ void UrlBar::setQUrl(const QUrl& url) clearFocus(); KLineEdit::setUrl(url); setCursorPosition(0); - _icon->setIcon(Application::icon(url)); + refreshFavicon(); } } @@ -494,3 +496,16 @@ void UrlBar::suggest() if(!_box.isNull()) _box.data()->suggestUrls( text() ); } + + +void UrlBar::refreshFavicon() +{ + kDebug() << "------------------ REFRESH ME!!! -------------"; +// if( u.scheme() == QL1S("about") ) +// { +// kDebug() << "ABOUT SCHEME..."; +// return; +// } + + _icon->setIcon(Application::iconManager()->iconForUrl(_tab->view()->url())); +} -- cgit v1.2.1