[Kst] [Bug 128436] invalid fields should not be loaded as 0 (zeroes)
nicolas.brisset at eurocopter.com
Fri Jun 16 15:52:42 CEST 2006
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
------- Additional Comments From nicolas.brisset eurocopter com 2006-06-16 15:52 -------
One user just came to me and complained about that behavior again after scratching her head for a (long !) while trying to understand what she was looking at: 0 is too common a value to raise the user's attention that something has gone wrong when loading the .kst file.
Considering George's insightful comments about not breaking the object chain and giving the user a chance to repair, I'd say we should either:
- initialize the fields with NaNs instead of 0s (my preferred, as the curves would not even show, which will surely not pass unnoticed !) unless that breaks something further down the chain if some plugins or equations "dislike" that and crash
- in the case where NaNs are not an option, check with isValidField(...) before loading the vector, and if it is not still initialize with 0 BUT WARN THE USER with a dialog like the one I was mentioning, which by the way is the one at line 544 of kstdoc.cpp (I don't exactly know when it is shown, but I believe it could be used for unexisting fields as well).
More information about the Kst