mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
Remember non-expanded state in 'remember_tree_state()' too
The 'remember_tree_state()' thing is meant to remember if a dive trip is expanded or not, but it missed the "or not" part. IOW, it never cleared the expanded flag, it only ever set it. As a result, if you were doing multiple operations on the divelist tree (testing all the recent gtk-model removal, for example) the dive trips would end up expanding more and more, even if you collapsed things by hand in between operations. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
62193fd4f7
commit
aa6b164a3e
1 changed files with 3 additions and 6 deletions
|
@ -1886,14 +1886,11 @@ void remember_tree_state()
|
|||
GtkTreePath *path;
|
||||
|
||||
gtk_tree_model_get(TREEMODEL(dive_list), &iter, DIVE_INDEX, &idx, -1);
|
||||
if (idx >= 0)
|
||||
trip = find_trip_by_idx(idx);
|
||||
if (!trip)
|
||||
continue;
|
||||
path = gtk_tree_model_get_path(TREEMODEL(dive_list), &iter);
|
||||
if (gtk_tree_view_row_expanded(GTK_TREE_VIEW(dive_list.tree_view), path)) {
|
||||
trip = find_trip_by_idx(idx);
|
||||
if (trip)
|
||||
trip->expanded = TRUE;
|
||||
}
|
||||
trip->expanded = gtk_tree_view_row_expanded(GTK_TREE_VIEW(dive_list.tree_view), path);
|
||||
gtk_tree_path_free(path);
|
||||
} while (gtk_tree_model_iter_next(TREEMODEL(dive_list), &iter));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue