summaryrefslogtreecommitdiff
path: root/src/bookmarks/bookmarkstreemodel.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-08-21 01:26:14 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-08-21 01:26:14 +0200
commit8a752526177e37b7b8fc91abbd2952bdfe77d155 (patch)
treeb9b503ab044d0d2559668984f89224c6c1afe1bc /src/bookmarks/bookmarkstreemodel.cpp
parentMerge branch 'opensearch2' (diff)
parentBookmarkProvider's code reordered (diff)
downloadrekonq-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.cpp25
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;
}