Silly problem with dive sites and GPS downloading

Linus Torvalds torvalds at linux-foundation.org
Sat Sep 22 15:17:38 PDT 2018


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..

              Linus


More information about the subsurface mailing list