febcbd6325e: Add the ability to edit the date/time of a dive

Dirk Hohndel dirk at hohndel.org
Fri Dec 14 23:02:56 PST 2012


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

> + some questions about auto-grouping.
>
> since now it is possible edit the timestamp of a dive, there might be
> certain conditions that trigger undefined behaviour.
> this is mainly because trips in the GTK list are retrieved by
> timestamp, but also that trips normally receive the earliest timestamp
> when dives are added.
> perhaps a second look is needed here to clear all possible corner cases.
>
> i'm far for understanding exactly how everything about merging and
> auto-grouping works..
> ...also i never understood why are there two places where
> auto-grouping can be enabled - one in the preferences and one in the
> menu.
> i wonder which one has priority and isn't that confusing to the user?
>
> 1) is it normal to edit the timestamp of a dive to a very early date
> e.g. year 2003, press OK and then the dive remains in the same trip
> which has a trip date of 2011?
> shouldn't the trip timestamp update as well, always pointing to the
> earliest dive?

That is a bug. The plan was to remove the dive from the trip if it moves
outside of the time range. My mistake, I appear to have forgotten to
commit that part.

> 2) shouldn't one of the auto-group options be removed?

Yes, the one in the preferences will be removed

> 3) here is a patch the commit message of which is:
>
> [PATCH] Change the assert when merging trips to a branch
>
> divelistc:merge_trips_cb():
> The present assertion can fail, if the user has two dives that were
> previously edited to have the same timestamp (febcbd6325e42),
> but then each dive is added to his own trip that also receives
> the same timestamp.

Two dives cannot have the same time stamp. That makes no sense - how can
you be on two dives at the same time?

> Instead of terminating the program, perhaps it's sufficient
> to simply check and only move dives from one trip to another
> if the trips are indeed different.
>
> If the trips are the same fill_dive_list() seems to merge the two
> trips regardless.

I need to think about this some more...

/D


More information about the subsurface mailing list