diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-08-28 19:24:19 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-08-28 19:24:19 +0200 |
commit | f0c11eadaa4b77a4e36130b014b62cd6200c8211 (patch) | |
tree | 556625dc98766a444ea2b916e76446c2cb379357 /src/bookmarks | |
parent | Merge commit 'refs/merge-requests/192' of git://gitorious.org/rekonq/mainline (diff) | |
download | rekonq-f0c11eadaa4b77a4e36130b014b62cd6200c8211.tar.xz |
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...
Diffstat (limited to 'src/bookmarks')
-rw-r--r-- | src/bookmarks/bookmarkprovider.cpp | 4 | ||||
-rw-r--r-- | src/bookmarks/bookmarkstreemodel.cpp | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/bookmarks/bookmarkprovider.cpp b/src/bookmarks/bookmarkprovider.cpp index ec02ed31..3459108d 100644 --- a/src/bookmarks/bookmarkprovider.cpp +++ b/src/bookmarks/bookmarkprovider.cpp @@ -39,6 +39,7 @@ // KDE Includes #include <KActionCollection> #include <KStandardDirs> +#include <KMimeType> // Qt Includes #include <QtCore/QFile> @@ -230,7 +231,8 @@ void BookmarkProvider::fillBookmarkBar(BookmarkToolBar *toolBar) void BookmarkProvider::slotAddBookmark() { - rootGroup().addBookmark(bookmarkOwner()->currentTitle(), bookmarkOwner()->currentUrl()); + QString url = bookmarkOwner()->currentUrl(); + rootGroup().addBookmark(bookmarkOwner()->currentTitle(), url, KMimeType::favIconForUrl( KUrl(url) ) ); bookmarkManager()->emitChanged(); } diff --git a/src/bookmarks/bookmarkstreemodel.cpp b/src/bookmarks/bookmarkstreemodel.cpp index ee19daf1..ba106ca5 100644 --- a/src/bookmarks/bookmarkstreemodel.cpp +++ b/src/bookmarks/bookmarkstreemodel.cpp @@ -62,8 +62,11 @@ QVariant BtmItem::data(int role) const return m_kbm.text(); if (role == Qt::DecorationRole) + { + kDebug() << "BOOKMARK ICON: " << m_kbm.icon(); return KIcon(m_kbm.icon()); - + } + if (role == Qt::UserRole) return m_kbm.url(); |