[Kst] branches/work/kst/1.5/kst/src/libkstapp

Duncan Hanson duncan.hanson at gmail.com
Wed May 16 00:54:41 CEST 2007


SVN commit 665126 by dhanson:

CCBUG:86915 set plots' scalar outputs to be orphans-> so they are saved in the kst file and will always be available to objects when kst starts up.

 M  +24 -4     kst2dplot.cpp  
 M  +1 -1      kst2dplot.h  


--- branches/work/kst/1.5/kst/src/libkstapp/kst2dplot.cpp #665125:665126
@@ -7133,14 +7133,30 @@
     KST::scalarList.setUpdateDisplayTags(false);
 
     KstScalarPtr sp;
-    _scalars.insert("xmin", sp = new KstScalar(KstObjectTag("XMin", tag()), this));
+
+    sp = *KST::scalarList.findTag(KstObjectTag("XMin", tag()));
+    if (!sp) { sp = new KstScalar(KstObjectTag("XMin", tag()), this); }
+    _scalars.insert("xmin", sp);
     sp->_KShared_ref();
-    _scalars.insert("xmax", sp = new KstScalar(KstObjectTag("XMax", tag()), this));
+    sp->setOrphan(true); //seems kind of funny, but is req'd for the scalar to be saved. this should be done so that these scalars are be produced before vectorviews (and other objects which might want to use them) when a .kst session is recreated.
+
+    sp = *KST::scalarList.findTag(KstObjectTag("XMax", tag()));
+    if (!sp) { sp = new KstScalar(KstObjectTag("XMax", tag()), this); }
+    _scalars.insert("xmax", sp);
     sp->_KShared_ref();
-    _scalars.insert("ymin", sp = new KstScalar(KstObjectTag("YMin", tag()), this));
+    sp->setOrphan(true);
+
+    sp = *KST::scalarList.findTag(KstObjectTag("YMin", tag()));
+    if (!sp) { sp = new KstScalar(KstObjectTag("YMin", tag()), this); }
+    _scalars.insert("ymin", sp);
     sp->_KShared_ref();
-    _scalars.insert("ymax", sp = new KstScalar(KstObjectTag("YMax", tag()), this));
+    sp->setOrphan(true);
+
+    sp = *KST::scalarList.findTag(KstObjectTag("YMax", tag()));
+    if (!sp) { sp = new KstScalar(KstObjectTag("YMax", tag()), this); }
+    _scalars.insert("ymax", sp);
     sp->_KShared_ref();
+    sp->setOrphan(true);
 
     KST::scalarList.setUpdateDisplayTags(true);
 }
@@ -7173,6 +7189,10 @@
   RenameScalars();
 }
 
+const QDict<KstScalar>& Kst2DPlot::scalars() const {  
+  return _scalars;
+}
+
 QWidget *Kst2DPlot::configWidget() {
   return new View2DPlotWidget;
 }
--- branches/work/kst/1.5/kst/src/libkstapp/kst2dplot.h #665125:665126
@@ -141,6 +141,7 @@
   void popPlotColors();
 
   void updateScalears();
+  const QDict<KstScalar>& scalars() const;
 
   /** Set the scale */
   void setScale(double xmin, double ymin, double xmax, double ymax);
@@ -398,7 +399,6 @@
 
 signals:
   void modified();
-  void scaleChanged();
 
 public slots:
   void copy();


More information about the Kst mailing list