summaryrefslogtreecommitdiff
path: root/src/bookmarks/bookmarkstreemodel.cpp
diff options
context:
space:
mode:
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;
}