Version: 1.2.0_devel (using KDE 3.4.0, compiled sources) Compiler: gcc version 3.4.3 OS: SunOS (sun4u) release 5.8 This was first suggested in bug #117817 (fit labels update problem) but Andrew said it belonged in a separate report... There are now actually two ideas, but I suppose they are strongly linked together so that one report should be OK. If you create an equation with the expression "[Vec1] + 1.5]", in the corresponding legend it will say "Vec1 + 15". This can be misleading... If there is no compelling reason to drop dots in the equation names, I'd suggest keeping them. Similarly, if the name is too long it will be truncated with an ellipsis. While this may be required to fit in a legend box for instance, I think it would be better to keep the complete name e.g. to find it in the data manager. If at some point we need to make it shorter, wecan probably used a KSqueezedText or similar class that will care for that "downstream".
The problem is not with the name in the legend (which correctly gives the curve name) but is with the name of the curve created from the expression.
I agree that the problem is "upstream", i.e. when the curve name gets created. That's why I suggested to create the most logical curve name (not abbreviated, and with all the dots in it) and only squeeze it where it makes sense.
Should be fixed for 1.2.1 release
The problem is in KstEqDialogI::newObject() which both removes "." in the equation name: QString etext = _w->_equation->text(); etext.remove(QRegExp("[^a-zA-Z0-9\\(\\)\\+\\-\\*/\\%\\^\\|\\&\\!<>=_]")); and also truncates the equation name to 12 characters: if (etext.length() > 12) { etext.truncate(12); etext += "..."; } Can anyone explaing the reason for the former? The latter is for more obvious reasons, but why not follow Nicolas' idea and truncate the name when it is displayed?
r368837 | staikos | 2004-12-06 00:48:41 -0500 (Mon, 06 Dec 2004) | 4 lines Sanify generated equation names. Thoughts on this? Could be better maybe? BUG: 93021
So, is there any reason to remove "." from the equation name?
There doesn't seem to be any reason to remove it, so lets un-remove it.
SVN commit 544119 by arwalker: CCBUG:118737 Do not remove '.' from equation name as there is no good reason to do so. M +1 -1 ksteqdialog_i.cpp --- trunk/extragear/graphics/kst/src/libkstapp/ksteqdialog_i.cpp #544118:544119 @@ -144,7 +144,7 @@ bool KstEqDialogI::newObject() { QString tag_name = _tagName->text(); QString etext = _w->_equation->text(); - etext.remove(QRegExp("[^a-zA-Z0-9\\(\\)\\+\\-\\*/\\%\\^\\|\\&\\!<>=_]")); + etext.remove(QRegExp("[^a-zA-Z0-9\\(\\)\\+\\-\\*/\\%\\^\\|\\&\\!<>=_.]")); if (etext.length() > 12) { etext.truncate(12); etext += "...";
Do we still want to truncate the name to 12 characters or leave the name untruncated and handle the display issues where necessary?
Making very long names affects usage in KstScript too. I don't want anymore playing around with the tag name generation unless we have a clear definition of what a tagname is first. In terms of length, a long tagname is a bit annoying to deal with. I prefer truncation and then finding a unique name in a collision case.
The dot issue has been fixed. We will keep truncating to 12 characters. Barring someone coming up with a better tag name for equations, the best suggestion is to encourage users to name their equations themselves.