aboutsummaryrefslogtreecommitdiff
path: root/lib/bookmarks/bookmarkitem.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2020-01-18 13:48:29 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2020-01-18 13:48:29 +0200
commit16b9c5d33c6e98175979a6fb24b0f59036eb4035 (patch)
tree86be238e1bcf38637522563442a8950746a1e5d7 /lib/bookmarks/bookmarkitem.cpp
parentFix various gcc and clazy compile warnings (diff)
parentbookmarks: implicitly append if export is not set (diff)
downloadsmolbote-16b9c5d33c6e98175979a6fb24b0f59036eb4035.tar.xz
Merge branch 'bookmarks-subcommand'
Diffstat (limited to 'lib/bookmarks/bookmarkitem.cpp')
-rw-r--r--lib/bookmarks/bookmarkitem.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/bookmarks/bookmarkitem.cpp b/lib/bookmarks/bookmarkitem.cpp
index 21d034f..d361e26 100644
--- a/lib/bookmarks/bookmarkitem.cpp
+++ b/lib/bookmarks/bookmarkitem.cpp
@@ -13,13 +13,7 @@
BookmarkItem::BookmarkItem(const QVector<QVariant> &data, Type type, BookmarkItem *parent)
{
m_parentItem = parent;
-
m_type = type;
- 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));
m_data.resize(FieldCount);
for(int i = 0; i < FieldCount; ++i) {
@@ -104,8 +98,14 @@ bool BookmarkItem::setData(Fields column, const QVariant &data)
return true;
}
-QIcon BookmarkItem::icon() const
+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;
}