[PULL REQUEST] Delete multiple dives

Dirk Hohndel dirk at hohndel.org
Wed Sep 26 08:14:42 PDT 2012


"Lubomir I. Ivanov" <neolit123 at gmail.com> writes:

> On 24 September 2012 16:13, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
>> i think i have a slightly better solution i.e. calling
>> update_trip_timestamp() only once.
>> will give it a try later today and submit again.
>
> thought about this a bit more and i don't think it will be possible to
> call update_trip_timestamp() only once.
> if the user wants to delete, say the last dive from 10 different trips
> (which is currently quite possible), we still need to call
> update_trip_timestamp() 10 times, since there are 10 trips to update.
>
> latest proposal stands, i guess.
> what can be optimized is to reduce the amount of calls to realloc(),
> but allocating the buffer in chunks of n GtkTreeIter entries (e.g.
> 128), instead of incrementing by one each time. i'm going to leave
> that for now, unless requested.

I have looked at the latest code in the branch and like what is
there. Pulled and pushed.

One suggested follow up patch:

Because the tree is recreated after the dives are deleted, and because
the selected dives are deleted, all dive trips collapse after this
happens. This is visually confusing, especially if I deleted just some
of the dives of a trip.

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

/D


More information about the subsurface mailing list