Save / Restore the Tree after organizing by other columns.

This patch saves and restores the state of the TreeView after the user
clicks on another columns that will make the tree disappear. All of the
branche states are saved, this way the expanded nodes will be restored
when the user gets back to tree mode.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2013-11-08 21:08:14 -02:00 committed by Dirk Hohndel
parent 38287a1c1e
commit d3fe3494fe
2 changed files with 28 additions and 17 deletions

View file

@ -49,6 +49,7 @@ signals:
private:
bool mouseClickSelection;
QList<int> expandedRows;
int sortColumn;
Qt::SortOrder currentOrder;
DiveTripModel::Layout currentLayout;
@ -56,6 +57,8 @@ private:
QModelIndex contextMenuIndex;
void merge_trip(const QModelIndex &a, const int offset);
void setupUi();
void backupExpandedRows();
void restoreExpandedRows();
};
#endif // DIVELISTVIEW_H