Restore autofilling coordinates for added dives

Dirk Hohndel dirk at
Wed Jul 9 08:39:58 PDT 2014

On Tue, Jul 08, 2014 at 06:09:19PM -1000, Gaetan Bisson wrote:
> Introduce on_location_editingFinished() and move the GPS coordinates
> completion logic there. This simplifies acceptChanges(), but replaces
> the clever code for multidive completion by something much more
> straightforward:
> - The old code used to compare the locations from multiple sources
>   (displayed_dive, current_dive, mydive, ui, etc.) to determine what
> subset of a multidive selection it should update with the automatic
> completion for GPS coordinates based on the newly entered location.
> - The new on_location_editingFinished() only works on displayed_dive,
>   and whatever changes it makes to the coordinates field are then saved
> normally, as any other field would, regardless of whether a single or
> multiple dives are selected.

While this is one possible way to do this, it violates our design logic.
Now people can disagree with that logic, but here is how things are
suppsoed to work:

if you edit multiple dives, one of them is displayed (the current_dive).
When you change a value on that dive, it is modified in all selected dives
that previously had the same value. So if you have five dives selected
with no location (all locations are the same), then you set the location
in all dives. But if you have two with location Wall and three with
location Lake, the current_dive (what you see on the screen) is Lake and
you change that to River, then the dives with location Wall should still
have the location Wall.

Your patch breaks that.

> I believe the simplicity and behavioral predictability of the new code
> is worth getting rid of the obscure magic of the old code for. That is
> perhaps debatable...

I think it is. :-)
Seriously, you guys can try to talk me (and Linus) out of this, but I'm
rather convinced that this is the correct and reasonable logic.


More information about the subsurface mailing list