aboutsummaryrefslogtreecommitdiffstats
path: root/display-gtk.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-08-13 14:42:55 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-08-14 12:43:15 -0700
commit27a505e579057596ab10f7381c471b870ce86f87 (patch)
tree7aba002f4d1aa012ca152946e56a9f5fbbee1ded /display-gtk.h
parent5f1e41de4376bef1968a42f48e3fb04bf10a52cb (diff)
downloadsubsurface-27a505e579057596ab10f7381c471b870ce86f87.tar.gz
Create duplicate list model so sorting by columns works again
One major downside of the switch to a tree model is that sorting by columns other than date was broken - it would sort the entries within each date which is not all that useful. After playing with some Gtk trickery that would allow us to filter out those rows it quickly became clear that the much easier solution is to simply maintain TWO models (and therefore two storages). This causes some overhead and requires some careful tracking of all changes, but it turned out to be rather straight forward to do. dive_list now has three model related members: model - current model displayed (which is one of the following two) treemodel - the tree model listmodel - the list model One side effect is that the callbacks no longer can pass the model around (as this could have changed since the callback was registered), but that seems only a minor drawback and was easily addressed. The implementation in this commit still has a couple of obvious flaws: when switching back from the list model to the tree model all the expansion state of the rows is lost and we end up with just a list of the different years visible. Also, selections aren't maintained when switching models. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'display-gtk.h')
0 files changed, 0 insertions, 0 deletions