diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-02-19 23:50:55 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-02-19 23:55:24 -0800 |
commit | b406dbe1c05fa618c3c1d1f23751ccf07629f0d3 (patch) | |
tree | f41b82f946d8adec1875c6183e7423624d80b320 /equipment.c | |
parent | 18a4d76ca58708a318154f07b85fb363151b84ff (diff) | |
download | subsurface-b406dbe1c05fa618c3c1d1f23751ccf07629f0d3.tar.gz |
Fix tracking of selected dives across sort column changes
With commit 800b0482f39e ("When switching sort order, scroll the dive
list to the current dive") we introduced an unwanted new behavior. When
changing sort columns we could lose all selections except for the main
"selected_dive". This was caused by the call to gtk_tree_view_set_cursor
on the selected_dive which unselected all other dives.
As a side-effect this also fixed another bug that was introduced by the
same change: shift-cursor-up and -down now works again to select multiple
dives with the keyboard.
But fixing that bug unearthed a different issue. Our code that restored
the selection state of the tree model oddly decided to mark a divetrip as
selected if its first child was selected. The bug above masked that by
immediately unselecting the trip again, but now that this was fixed the
problem was immediately obvious: we would start with both the first trip
and the first dive in that trip selected (well, since we are in reverse
order it's actually the chronologically last trip and last dive...).
Instead we now use the remembered state of the trip to determine whether
it should be expanded or selected.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'equipment.c')
0 files changed, 0 insertions, 0 deletions