mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-08 21:14:14 +02:00
7933e89dc0
ConductorProperties::toSettings() writes the conductor width with QString::number(cond_size), e.g. "1.4", and fromSettings() read it back with toInt(), which is 0 for any value that is not a whole number. A default width of 1.4 set in the configuration became 0 on the next start, so every new conductor was drawn with a pen of width 0. Read it with toDouble(), and fall back to 1 when the stored value is not a positive finite number (a hand-edited or truncated settings file), as the other fallbacks in fromSettings() do. No file-format change: this is the settings file only; the project file's condsize attribute was already read with toDouble(). Tests: tst_conductorsizesetting compiles conductorproperties.cpp alone and round-trips 2, 1.4, 0.4, 61.3 and 61.7 through toSettings() and fromSettings() in a QSettings scope of its own; text, 0, -1, nan, inf and a missing value give 1. Nine of the cases fail on master. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Beat Hangartner <beat@hangartners.ch>