Bug 120746 - saved .kst files don't save the Legend Text of a curve
Summary: saved .kst files don't save the Legend Text of a curve
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-24 23:58 UTC by Matthew Truch
Modified: 2006-01-25 00:27 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Truch 2006-01-24 23:58:27 UTC
Version:           1.2.0_svn_502068 (using KDE KDE 3.5.0)
OS:                Linux

How to Reproduce:
Create at least on plot that has a legend.  Change the legend text of at least one of the curves displayed on the legend to something other than the default name.  Save a .kst file for the session.  Close kst.  Open kst with the saved .kst file.

What Happens:  
Kst is loaded with the exact same state as when you clicked save EXCEPT that the custom legend name(s) have been forgotten.

Expected Behavior:
Kst saves the Legend Text into the .kst files appropriatly.
Comment 1 Andrew Walker 2006-01-25 00:27:32 UTC
SVN commit 502146 by arwalker:

BUG:120746 Save the custom legend text associated with a curve or image.

 M  +3 -0      kstimage.cpp  
 M  +3 -1      kstvcurve.cpp  


--- trunk/extragear/graphics/kst/kst/kstimage.cpp #502145:502146
@@ -47,6 +47,8 @@
         in_tag = e.text();
       } else if (e.tagName() == "matrixtag") {
         in_matrixName = e.text();
+      } else if (e.tagName() == "legend") {
+        setLegendText(e.text());
       } else if (e.tagName() == "palettename") {
         in_paletteName = e.text();
       } else if (e.tagName() == "lowerthreshold") {
@@ -176,6 +178,7 @@
   if (_inputMatrices.contains(THEMATRIX)) {
     ts << l2 << "<matrixtag>" << QStyleSheet::escape(_inputMatrices[THEMATRIX]->tagName()) << "</matrixtag>" << endl;
   }
+  ts << l2 << "<legend>" << QStyleSheet::escape(legendText()) << "</legend>" << endl;
   ts << l2 << "<hascolormap>" << _hasColorMap << "</hascolormap>" <<endl;
   if (_pal) {
     ts << l2 << "<palettename>" << QStyleSheet::escape(_pal->name()) << "</palettename>" << endl;
--- trunk/extragear/graphics/kst/kst/kstvcurve.cpp #502145:502146
@@ -140,7 +140,8 @@
         eyminusname = e.text();
       } else if (e.tagName() == "color") {
         in_color.setNamedColor(e.text());
-
+      } else if (e.tagName() == "legend") {
+        setLegendText(e.text());
       // the following options are only needed to change from the default
       } else if (e.tagName() == "hasLines") {
         HasLines = (e.text() != "0");
@@ -463,6 +464,7 @@
   ts << l2 << "<tag>" << QStyleSheet::escape(tagName()) << "</tag>" << endl;
   ts << l2 << "<xvectag>" << QStyleSheet::escape(_inputVectors[COLOR_XVECTOR]->tagName()) << "</xvectag>" << endl;
   ts << l2 << "<yvectag>" << QStyleSheet::escape(_inputVectors[COLOR_YVECTOR]->tagName()) << "</yvectag>" << endl;
+  ts << l2 << "<legend>" << QStyleSheet::escape(legendText()) << "</legend>" << endl;
   ts << l2 << "<hasMinus/>" << endl;
   if (_inputVectors.contains(EXVECTOR)) {
     ts << l2 << "<exVectag>" << QStyleSheet::escape(_inputVectors[EXVECTOR]->tagName()) << "</exVectag>" << endl;