diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-10-06 14:02:45 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-10-06 14:02:45 +0200 |
commit | 09cfc76fc8af203240e3510928f75d36ba47cb0a (patch) | |
tree | 24c5f17892e98b09aa2b82c51277da150682c399 /lib/bookmarks/model/bookmarkmodel.cpp | |
parent | bookmarks: fix new/delete buttons (diff) | |
download | smolbote-09cfc76fc8af203240e3510928f75d36ba47cb0a.tar.xz |
bookmarks: save folder expanded state
Diffstat (limited to 'lib/bookmarks/model/bookmarkmodel.cpp')
-rw-r--r-- | lib/bookmarks/model/bookmarkmodel.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/bookmarks/model/bookmarkmodel.cpp b/lib/bookmarks/model/bookmarkmodel.cpp index aa8b0ac..977248c 100644 --- a/lib/bookmarks/model/bookmarkmodel.cpp +++ b/lib/bookmarks/model/bookmarkmodel.cpp @@ -104,6 +104,13 @@ bool BookmarkModel::isItemExpanded(const QModelIndex &index) const return static_cast<BookmarkItem *>(index.internalPointer())->isExpanded(); } +void BookmarkModel::setItemExpanded(const QModelIndex& index, bool expanded) +{ + BookmarkItem *item = getItem(index); + if(item->type() == BookmarkItem::Folder) + item->setExpanded(expanded); +} + int BookmarkModel::rowCount(const QModelIndex &index) const { if(index.column() > 0) |