Silly problem with dive sites and GPS downloading

Dirk Hohndel dirk at hohndel.org
Sat Sep 22 17:42:06 PDT 2018


> On Sep 22, 2018, at 3:17 PM, Linus Torvalds <torvalds at linux-foundation.org> wrote:
> 
> On Sat, Sep 22, 2018 at 2:35 PM Linus Torvalds
> <torvalds at linux-foundation.org> wrote:
>> 
>> But it's basically unfixable as it is now. As long as a "struct dive"
>> contains that broken "uint32_t dive_site_uuid;" as the dive site
>> descriptor, we *have* to create the dive site this way.
> 
> Side note: one possible solution is to get rid of that dive_site_uuid,
> and replace it with a "struct divesite *ds" instead.
> 
> Then, all the internal code is made to just use the pointers to the
> "struct divesite".
> 
> The only code that would use the uuid is the loading and saving code.
> The saving code would create a uuid by just hashing all the dive site
> data (so name, gps, information), and thus create a fake "uuid" that
> is really just a placeholder for the actual data. The loading code
> would create the divesite, and then use the uuid to look it up, but
> we'd never actually have to deal with a uuid in any of the code that
> *uses* divesites.
> 
> That would solve a lot of problems.
> 
> But there is a lot of UI code that uses that uuid right now. It
> doesn't deal in "struct divesite *", it literally deals in those
> uuid's.
> 
> That's the main problem with fixing this. I could do the loading and
> saving part. But not the Qt model parts..

I'm currently knee deep in the mobile UI... if I stop I will lose hours
of understanding what goes where... so let me finish that (ha!) and
then I'll think through this and see if I can come up with a way to 
make this work in the UI.

I'm not ignoring your idea - I'm just not able to task switch :-)

/D


More information about the subsurface mailing list