Skip to content

Fix parser treating empty IntList default as a list of single zero element: [0]

ivan tkachenko requested to merge work/ratijas/lists into master

Without Qt::SkipEmptyParts flag, string split method (practically in any other language / stdlib too) returns a list of one empty string, which toInt method parses as zero. Int parser should return an error, but the code in this config loader consistently doesn't check for errors.

Basically it's a choice between skipping empty parts or special-casing an empty m_default string. Note that StringList parsing is broken even more (FIXME and TODOs everywhere), and skipping empty parts won't be an option there, as an empty string might be a legal list element.

Merge request reports

Loading