summaryrefslogtreecommitdiffstats
path: root/subsurface.desktop
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2012-09-23 16:28:23 +0300
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2012-09-24 03:41:18 +0300
commit9036f3f80e32dc72280e6b9f6ff4560171210331 (patch)
tree45b22f88efa0352312c0f9c49918d927425e6a9b /subsurface.desktop
parent4d9abf6e8ee465728d1ff1308e18265557dbca42 (diff)
downloadsubsurface-9036f3f80e32dc72280e6b9f6ff4560171210331.tar.gz
Update the trip's "when" flag after deleting a dive from it
Both gtk_tree_selection_selected_foreach() and gtk_tree_selection_get_selected_rows() are problematic. gtk_tree_selection_get_selected_rows is not compatible with older GTK, while gtk_tree_selection_selected_foreach() should not be used to modify the tree. A workaround to is allocate memory and store what is returned from the gtk_tree_selection_selected_foreach() callback function as a GtkTreeIter array. Once done iterate trought the array and pass the values to delete_single_dive(). A bit excesive, but it is not certain how safe is modifying the tree while in the "_foreach" loop, even if it only shows a warning. On the other hand the GTK source shows gtk_tree_selection_get_selected_rows() to be a rather complicated and slow method. Inside delete_single_dive(), once a dive is no longer part of "dive_table" and if the dive was part of a trip, remove the dive from the tree (gtk_tree_store_remove()) and call update_trip_timestamp(). The struct type "tree_selected_st" and tree_selected_foreach() are reusable. Reported-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'subsurface.desktop')
0 files changed, 0 insertions, 0 deletions