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/bookmarkswidget.cpp | |
parent | bookmarks: fix new/delete buttons (diff) | |
download | smolbote-09cfc76fc8af203240e3510928f75d36ba47cb0a.tar.xz |
bookmarks: save folder expanded state
Diffstat (limited to 'lib/bookmarks/bookmarkswidget.cpp')
-rw-r--r-- | lib/bookmarks/bookmarkswidget.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/bookmarks/bookmarkswidget.cpp b/lib/bookmarks/bookmarkswidget.cpp index 1a4552a..2949b44 100644 --- a/lib/bookmarks/bookmarkswidget.cpp +++ b/lib/bookmarks/bookmarkswidget.cpp @@ -60,9 +60,17 @@ BookmarksWidget::BookmarksWidget(const QString &path, QWidget *parent) connect(ui->treeView, &QTreeView::activated, this, [this](const QModelIndex &index) { if(index.column() == 1) emit openUrl(index.data(Qt::DisplayRole).toUrl()); - else { + else editBookmark(index); - } + }); + + connect(ui->treeView, &QTreeView::expanded, this, [this](const QModelIndex &index) { + model->setItemExpanded(index, true); + m_isChanged = true; + }); + connect(ui->treeView, &QTreeView::collapsed, this, [this](const QModelIndex &index) { + model->setItemExpanded(index, false); + m_isChanged = true; }); // addBookmark |