diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-04 19:37:20 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-04 19:37:20 +0100 |
| commit | b242394c0f9c24ca8f9bbced44076abbcd274fee (patch) | |
| tree | af51b9c5b4fe0668d996c4d8f15298fa255a1a89 /src/modlistview.h | |
| parent | 85cd33715723f294abeeb8a0f3f77c0de27f6a37 (diff) | |
Keep track of expanded items in the view instead of the models.
Diffstat (limited to 'src/modlistview.h')
| -rw-r--r-- | src/modlistview.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/modlistview.h b/src/modlistview.h index faa33b6a..ed4ad2d0 100644 --- a/src/modlistview.h +++ b/src/modlistview.h @@ -1,6 +1,8 @@ #ifndef MODLISTVIEW_H
#define MODLISTVIEW_H
+#include <map>
+#include <set>
#include <vector>
#include <QLabel>
@@ -203,10 +205,9 @@ private: std::pair<QModelIndex, QModelIndexList> selected() const;
void setSelected(const QModelIndex& current, const QModelIndexList& selected);
- // call expand() after fixing the index if it comes from the source
- // of the proxy
+ // refresh stored expanded items for the current intermediate proxy
//
- void expandItem(const QModelIndex& index);
+ void refreshExpandedItems();
// refresh the group-by proxy, if the index is -1 will refresh the
// current one (e.g. when changing the sort column)
@@ -249,6 +250,10 @@ private: QtGroupingProxy* m_byCategoryProxy;
QtGroupingProxy* m_byNexusIdProxy;
+ // maintain collapsed items for each proxy to avoid
+ // losing them on model reset
+ std::map<QAbstractItemModel*, std::set<QString>> m_collapsed;
+
struct MarkerInfos {
// conflicts
std::set<unsigned int> overwrite;
|
