diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-08-21 01:26:14 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-08-21 01:26:14 +0200 |
commit | 8a752526177e37b7b8fc91abbd2952bdfe77d155 (patch) | |
tree | b9b503ab044d0d2559668984f89224c6c1afe1bc /src/bookmarks/bookmarkstreemodel.cpp | |
parent | Merge branch 'opensearch2' (diff) | |
parent | BookmarkProvider's code reordered (diff) | |
download | rekonq-8a752526177e37b7b8fc91abbd2952bdfe77d155.tar.xz |
Merge commit 'refs/merge-requests/182' of git://gitorious.org/rekonq/mainline into m182
Diffstat (limited to 'src/bookmarks/bookmarkstreemodel.cpp')
-rw-r--r-- | src/bookmarks/bookmarkstreemodel.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/bookmarks/bookmarkstreemodel.cpp b/src/bookmarks/bookmarkstreemodel.cpp index 7f0bf66f..ee19daf1 100644 --- a/src/bookmarks/bookmarkstreemodel.cpp +++ b/src/bookmarks/bookmarkstreemodel.cpp @@ -30,7 +30,11 @@ // Local Includes #include "application.h" -#include "bookmarksmanager.h" +#include "bookmarkprovider.h" + +// KDE Includes +#include <KBookmarkManager> +#include <KLocalizedString> // Qt Includes #include <QtCore/QMimeData> @@ -56,28 +60,27 @@ QVariant BtmItem::data(int role) const if (role == Qt::DisplayRole) return m_kbm.text(); + if (role == Qt::DecorationRole) return KIcon(m_kbm.icon()); + if (role == Qt::UserRole) return m_kbm.url(); + if (role == Qt::ToolTipRole) { - QString tooltip = ""; - - if (!m_kbm.fullText().isEmpty()) - { - tooltip += m_kbm.fullText(); - } + QString tooltip = m_kbm.fullText(); if (m_kbm.isGroup()) - { tooltip += i18ncp("%1=Number of items in bookmark folder", " (1 item)", " (%1 items)", childCount()); - } - if (!m_kbm.url().url().isEmpty()) + + QString url = m_kbm.url().url(); + if (!url.isEmpty()) { if (!tooltip.isEmpty()) tooltip += '\n'; - tooltip += m_kbm.url().url(); + tooltip += url; } + return tooltip; } |