DivelogImportDialog

Miika Turkia miika.turkia at gmail.com
Sun Sep 25 02:37:07 PDT 2016


On Sat, Sep 24, 2016 at 6:38 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
> Miika,
>
> Can you take a look at the DivelogImportDialog for me? This code worries
> me:
>
> int DiveLogImportDialog::parseTxtHeader(QString fileName, char **params, int pnr)
> {
>         QFile f(fileNames.first());
>
> (and fileName is unused in the function)
>
> The only two call sites of parseTxtHeader look like this:
>
>         pnr = parseTxtHeader(fileNames[i], params, pnr);
>
> So the caller seems to think that the parseTxtHeader function will use
> item number 'i' in the array of fileNames, but instead the function
> ignores the parameter and always uses the first entry.
>
> git blame tells me that you wrote this :-)

A bit late reviewing the code :D But this works as well.

Patch sent. There is still a limitation when importing multiple files
on one go. The files must use same field separator. I wonder, if I
should try to detect the separator file-by-file or just let it be.
After all, same source of logs should use same separator for all
exports.

miika


More information about the subsurface mailing list