[Kst] Re: branches/work/kst/portto4/kst/src/datasources/ascii
Nicolas Brisset
nicolas.brisset at free.fr
Sat Feb 5 17:55:26 CET 2011
> - parts += QString(line).trimmed().split(QRegExp("[\\s]"), QString::SkipEmptyParts);
> + parts += QString(line).trimmed().split(regexS, QString::SkipEmptyParts);
Oops, that reminds me of something I had thought about and then forgotten to check: are all our regexps and split() calls so that empty strings are properly handled?
For fields, empty makes no sense but we could give them an automatic name. As for units, empty is OK as it is just ignored later down the line (when constructing the label), whereas skipping empty units probably introduces an offset.
I don't know if that is clear, but when we have delimiters or fixed-width columns empty fields/units can appear. I believe QString::KeepEmptyParts makes more sense then.
Nicolas
More information about the Kst
mailing list