[PATCH 1/2] Save all dive computer nicknames - whether used or not

Dirk Hohndel dirk at hohndel.org
Thu Jan 24 13:32:43 PST 2013


Linus Torvalds <torvalds at linux-foundation.org> writes:

> On Thu, Jan 24, 2013 at 12:58 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
>>
>> I name my Uemis SDA "my Uemis" (I'm totally creative that way). Then
>> Linus sends me his xml file linux.xml and he (being as creative as I am)
>> named his Uemis SDA "my Uemis". When I open his file I will see his
>> divecomputer as "my Uemis". I can then rename this (and save the file
>> again), but the next time he sends me a new version of the file it will
>> be back to his naming scheme.
>
> So the solution for this in the new world order is to have a separate
> XML file that has all the divecomputers in it. You can create it  it
> with something like
>
>   ( echo "<settings>"; \
>     grep -h 'divecomputerid' *.xml | sort -u; \
>     echo "</settings>" ) > divecomputers.xml
>
> and then you can edit things to your hearts content. In fact, you can
> edit it by just loading it from subsurface and use the dive computer
> nickname editor, but you can obviously also do it in a text editor
> (just remember to do the XML quoting if you do).
>
> Then, you just do
>
>     subsurface divecomputers.xml DirkDives.xml linus.xml
>
> and it all JustWorks(tm).

Interesting. I hadn't caught on to the fact that you take the first
entry that you see for a specific model/deviceid, not the last one that
you see. Yes, then this works just fine.

> So I really *really* hate the old system config string. It was
> horrible in so many ways, and it's actually much less flexible than
> the XML file is.

I think we have established this by now, Linus. That's why I asked you
to continue your cleanup of the code and that's why I already pushed
your changes.

/D


More information about the subsurface mailing list