[Kst] kdeextragear-2/kst/kst

Barth Netterfield netterfield at astro.utoronto.ca
Fri Jul 9 06:50:54 CEST 2004


CVS commit by netterfield: 

Reduce redraws in wizard to 1 per plot.
Plot dialog was not redrawing on edit or delete.  This fixes that.


  M +2 -6      datawizard.ui.h   1.56
  M +2 -2      kst2dplot.cpp   1.141
  M +1 -1      kst2dplot.h   1.60
  M +13 -8     kstplotdialog_i.cpp   1.49
  M +1 -1      ksttoplevelview.h   1.34


--- kdeextragear-2/kst/kst/datawizard.ui.h  #1.55:1.56
@@ -607,5 +607,5 @@ void DataWizard::finished()
       }
       KST::dataObjectList.append(KstDataObjectPtr(c));
-      static_cast<Kst2DPlot*>((*pit).data())->addCurve(c.data());
+      static_cast<Kst2DPlot*>((*pit).data())->addCurve(c.data(), false);
       if (!_onePlot->isChecked()) { // change plots if we are not onePlot...
         if (_radioButtonPlotDataPSD->isChecked()) { // if xy and psd
@@ -658,5 +657,5 @@ void DataWizard::finished()
         }
         KST::dataObjectList.append(KstDataObjectPtr(c));
-        static_cast<Kst2DPlot*>((*pit).data())->addCurve(c);
+        static_cast<Kst2DPlot*>((*pit).data())->addCurve(c, false);
         if (!_onePlot->isChecked()) { // change plots if we are not onePlot...
           if (++pit == plots.end()) {

--- kdeextragear-2/kst/kst/kst2dplot.cpp  #1.140:1.141
@@ -437,7 +437,7 @@ void Kst2DPlot::setYScaleMode(KstScaleMo
 }
 
-void Kst2DPlot::addCurve(KstBaseCurvePtr incurve) {
+void Kst2DPlot::addCurve(KstBaseCurvePtr incurve, bool set_dirty) {
   Curves.append(incurve);
-  setDirty();
+  if (set_dirty) setDirty();
 }
 

--- kdeextragear-2/kst/kst/kst2dplot.h  #1.59:1.60
@@ -80,5 +80,5 @@ public:
   void drawDotAt(QPainter& p, double x, double y);
   double xInternalAlignment();
-  void addCurve(KstBaseCurvePtr curve);
+  void addCurve(KstBaseCurvePtr curve, bool set_dirty = true);
   void removeCurve(KstBaseCurvePtr curve);
   void setXScaleMode(KstScaleModeType scalemode);

--- kdeextragear-2/kst/kst/kstplotdialog_i.cpp  #1.48:1.49
@@ -556,4 +556,5 @@ void KstPlotDialogI::new_I() {
   applyPlotColors(plot);
 
+  static_cast<KstViewWindow*>(c)->view()->paint(P_PLOT);
 
   update();
@@ -620,4 +621,6 @@ void KstPlotDialogI::edit_I() {
     // FIXMEPLOTLIST KST::plotList.arrangePlots(PlotCols->value());
     //doc->setDelay(UpdateDelay->value());
+    plot->setDirty();
+    static_cast<KstViewWindow*>(c)->view()->paint(P_PLOT);
 
     update();
@@ -643,4 +646,6 @@ void KstPlotDialogI::delete_I() {
   update();
 
+  static_cast<KstViewWindow*>(c)->view()->paint(P_PLOT);
+
   emit docChanged();
 }

--- kdeextragear-2/kst/kst/ksttoplevelview.h  #1.33:1.34
@@ -129,5 +129,5 @@ KstSharedPtr<T> KstTopLevelView::createP
     appendChild(plot);
   }
-  paint(P_DATA);
+  //paint(P_PAINT);
   return plot;
 }





More information about the Kst mailing list