[PULL REQUEST] Delete multiple dives

Lubomir I. Ivanov neolit123 at gmail.com
Thu Sep 27 12:48:20 PDT 2012

On 26 September 2012 20:44, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
> On 26 September 2012 18:14, Dirk Hohndel <dirk at hohndel.org> wrote:
>> Could you add code that remembers which trips were expanded and
>> re-expand those trips that still exist after the delete continues?
>> Extreme example: click 'expand all', delete a dive and see everything
>> collapse again. Unexpected...
>> Thanks
> np,
> will take a look at this tomorrow morning (GMT+3).

sorry for the delay,
here is what i came up, but not sure if this is the best solution.

i've noticed a strange problem and perhaps you could take a look at that:
when i switch the list to different sorting e.g. "by rating" the trips
disappear (i'm sure this is expected). but when i select all dives
(see attachment XML) and then click  "delete dives", some of them are
left out. this is mainly because i have a check if get_dive() returns
NULL in delete_single_dive(). as far as i understand, it shouldn't
return NULL. the same problem is absent when deleting all dives with
sorting "by date" enabled.

another problem is that the trips' "when" flags are not updated if we
delete dives when viewing dives sorted "by rating" and then returning
back to the "by date" sorting. i don't think update_trip_timestamp()
is optimal for this, since it takes an iterator for a parent (trip
iterator) that does not exist when we are not sorting "by date".

a question here i guess is: should the trips ever disappear if we sort
by something other than date ?


The following changes since commit bd3df859bcc08965bde4f38ca094e1191ad83bbd:

  Restructure the Uemis native download buffer code (2012-09-27 00:29:31 -0700)

are available in the git repository at:

  git at github.com:neolit123/subsurface.git delmulti

for you to fetch changes up to 4d3080f6987d770d8ddac1786779c520bfda1e72:

  Allow update_trip_timestamp() to modify the list of expanded trips
(2012-09-27 22:10:41 +0300)

Lubomir I. Ivanov (4):
      Ingore trips in selection when deleting multiple dives
      Set path_match to NULL when calling get_path_from_dive()
      Added methods to remember the expanded state of the tree
      Allow update_trip_timestamp() to modify the list of expanded trips

 divelist.c | 192 ++++++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 160 insertions(+), 32 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.xml
Type: text/xml
Size: 6837 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20120927/0abf794d/attachment.xml>

More information about the subsurface mailing list