[Kst] extragear/graphics/kst/kst

George Staikos staikos at kde.org
Mon Dec 19 18:10:36 CET 2005


SVN commit 489752 by staikos:

a great example of why public member variables are evil.  addCurve method was
bypassed in the dialog
BUG: 118457


 M  +2 -2      kst2dplot.cpp  
 M  +2 -2      kstiface_impl.cpp  
 M  +1 -1      kstplotdialog_i.cpp  


--- trunk/extragear/graphics/kst/kst/kst2dplot.cpp #489751:489752
@@ -6525,7 +6525,7 @@
 
 /** find the first legend owned by the plot, or return NULL if there is none */
 KstViewLegendPtr Kst2DPlot::legend() {
-  for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
+  for (KstViewObjectList::ConstIterator i = _children.begin(); i != _children.end(); ++i) {
     KstViewLegendPtr vl = kst_cast<KstViewLegend>(*i);
     if (vl) {
       return vl;
@@ -6542,7 +6542,7 @@
     vl = new KstViewLegend;
     appendChild(KstViewObjectPtr(vl), true);
     vl->resizeFromAspect(0.1, 0.1, 0.2, 0.1);
-    for (KstBaseCurveList::Iterator it = Curves.begin(); it != Curves.end(); ++it) {
+    for (KstBaseCurveList::ConstIterator it = Curves.begin(); it != Curves.end(); ++it) {
       vl->addCurve(*it);
     }
   }
--- trunk/extragear/graphics/kst/kst/kstiface_impl.cpp #489751:489752
@@ -249,7 +249,7 @@
   KST::dataObjectList.append(KstDataObjectPtr(vc));
   KST::dataObjectList.lock().writeUnlock();
 
-  plot->Curves.append(KstBaseCurvePtr(vc));
+  plot->addCurve(KstBaseCurvePtr(vc));
 
   _doc->forceUpdate();
   _doc->setModified();
@@ -343,7 +343,7 @@
   KST::dataObjectList.append(KstDataObjectPtr(vc));
   KST::dataObjectList.lock().writeUnlock();
 
-  plot->Curves.append(KstBaseCurvePtr(vc));
+  plot->addCurve(KstBaseCurvePtr(vc));
 
   _doc->forceUpdate();
   _doc->setModified();
--- trunk/extragear/graphics/kst/kst/kstplotdialog_i.cpp #489751:489752
@@ -823,7 +823,7 @@
   for (unsigned i = 0; i < DisplayedCurveList->count(); i++) {
     KstBaseCurveList::Iterator it = curves.findTag(DisplayedCurveList->text(i));
     if (it != curves.end()) {
-      plot->Curves.append(*it);
+      plot->addCurve(*it);
     }
   }
   curves.clear();


More information about the Kst mailing list