Bug 93021 - equation names are quite insane
Summary: equation names are quite insane
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: equations (show other bugs)
Version: 1.x
Platform: Compiled Sources Linux
: NOR major
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-10 12:17 UTC by George Staikos
Modified: 2010-08-14 14:40 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description George Staikos 2004-11-10 12:17:57 UTC
The names assigned to equations are quite insane.  Creating an equation with 
lots of vectors creates a name that has lots of brackets and is very very 
long.  We need a new naming scheme.  This makes it hard to use equations and 
in particular their slave vectors.  (think: using them in new equations)
Comment 1 George Staikos 2004-12-06 06:48:48 UTC
CVS commit by staikos: 

Sanify generated equation names.  Thoughts on this?  Could be better maybe?

BUG: 93021


  M +8 -1      ksteqdialog_i.cpp   1.72


--- kdeextragear-2/kst/kst/ksteqdialog_i.cpp  #1.71:1.72
@@ -20,4 +20,5 @@
 #include <qcheckbox.h>
 #include <qradiobutton.h>
+#include <qregexp.h>
 #include <qspinbox.h>
 
@@ -155,5 +156,11 @@ bool KstEqDialogI::new_I() {
 
   QString tag_name = _tagName->text();
-  tag_name.replace("<New_Equation>", Equation->text());
+  QString etext = Equation->text();
+  etext.remove(QRegExp("[^a-zA-Z0-9\\(\\)\\+\\-\\*/\\%\\^\\|\\&\\!<>=_]"));
+  if (etext.length() > 12) {
+    etext.truncate(12);
+    etext += "...";
+  }
+  tag_name.replace("<New_Equation>", etext);
 
   /* verify that the curve name is unique */


Comment 2 Peter Kümmel 2010-08-14 14:40:29 UTC
Change version to 1.x