aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/bookmarks/bookmarkitem.cpp20
-rw-r--r--lib/bookmarks/bookmarkitem.h1
2 files changed, 9 insertions, 12 deletions
diff --git a/lib/bookmarks/bookmarkitem.cpp b/lib/bookmarks/bookmarkitem.cpp
index 242ab57..b2ee78b 100644
--- a/lib/bookmarks/bookmarkitem.cpp
+++ b/lib/bookmarks/bookmarkitem.cpp
@@ -19,6 +19,15 @@ BookmarkItem::BookmarkItem(const QVector<QVariant> &data, Type type, BookmarkIte
for(int i = 0; i < FieldCount; ++i) {
m_data[i] = data.value(i, QVariant());
}
+
+ // set a default style if any can be set
+ if(qApp) {
+ if(m_type == Folder) {
+ m_icon.addPixmap(qApp->style()->standardPixmap(QStyle::SP_DirClosedIcon), QIcon::Normal, QIcon::Off);
+ m_icon.addPixmap(qApp->style()->standardPixmap(QStyle::SP_DirOpenIcon), QIcon::Normal, QIcon::On);
+ } else if(m_type == Bookmark)
+ m_icon.addPixmap(qApp->style()->standardPixmap(QStyle::SP_FileIcon));
+ }
}
BookmarkItem::~BookmarkItem()
@@ -98,17 +107,6 @@ bool BookmarkItem::setData(Fields column, const QVariant &data)
return true;
}
-QIcon BookmarkItem::icon()
-{
- if(m_icon.isNull() && m_type == Folder) {
- m_icon.addPixmap(qApp->style()->standardPixmap(QStyle::SP_DirClosedIcon), QIcon::Normal, QIcon::Off);
- m_icon.addPixmap(qApp->style()->standardPixmap(QStyle::SP_DirOpenIcon), QIcon::Normal, QIcon::On);
- } else if(m_icon.isNull() && m_type == Bookmark)
- m_icon.addPixmap(qApp->style()->standardPixmap(QStyle::SP_FileIcon));
-
- return m_icon;
-}
-
QIcon BookmarkItem::icon() const
{
return m_icon;
diff --git a/lib/bookmarks/bookmarkitem.h b/lib/bookmarks/bookmarkitem.h
index 310d263..6751526 100644
--- a/lib/bookmarks/bookmarkitem.h
+++ b/lib/bookmarks/bookmarkitem.h
@@ -48,7 +48,6 @@ public:
QVariant data(Fields column) const;
bool setData(Fields column, const QVariant &data);
- QIcon icon();
QIcon icon() const;
bool isExpanded() const;
void setExpanded(bool expanded);