Divelogs.de upload simplification

Lubomir I. Ivanov neolit123 at gmail.com
Tue Apr 28 14:33:36 PDT 2015

On 28 April 2015 at 21:39, Dirk Hohndel <dirk at hohndel.org> wrote:
> I didn't do a lot of searching in the git history, so I'm not quite sure
> why we did things the way we did them, but when battling the Windows path
> issue (aka libzip build issue) I spent a lot of time reading this code and
> couldn't help but shake my head about what we were doing.
> For every single dive we wanted to export, we wrote the dive to a
> temporary file as XML. Then immediately read the file back into memory
> where we processed it with an XSLT transformation. And then promptly
> forgot to delete that temporary file. Oops.
> Instead I changed the code to simply write the dive into a membuffer and
> then hand a pointer to the actual buffer to the XSLT transformation. No
> detour via the filesystem, no need to create temporary file names, no need
> to delete the files. Faster, easier, less code.
> Which of course has me worried that I'm missing something.
> I did test this and it seems to work fine, but I'd appreciate if people
> could give this a try. Lubomir, you wrote the original code... does this
> make sense?

i don't remember the exact reason, but i think this is a very sane
change and if it works we are good.
the original code dates back to something that Miika wrote for the GTK
version, which i amended for the GTK version and eventually ported it
to Qt. then Thiago added a lot of mods and did most of the divelogs.de
classes work in that matter.


More information about the subsurface mailing list