[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Tue Jun 29 20:03:11 CEST 2004


CVS commit by staikos: 

updatelets as we saw them


  M +10 -2     kst2dplot.cpp   1.120
  M +5 -15     kst2dplot.h   1.49
  M +7 -6      kstdoc.cpp   1.92


--- kdeextragear-2/kst/kst/kst2dplot.cpp  #1.119:1.120
@@ -59,4 +59,5 @@ Kst2DPlot::Kst2DPlot(const QString& in_t
                  double xmin_in, double ymin_in,
                  double xmax_in, double ymax_in) : KstPlotBase("Kst2DPlot") {
+  // Must stay here for plot loading correctness
   _pos_x = 0.0;
   _pos_y = 0.0;
@@ -81,4 +82,5 @@ Kst2DPlot::Kst2DPlot(QDomElement& e) : K
   bool x_log = false, y_log = false;
 
+  // Must stay here for plot loading correctness
   _pos_x = 0.0;
   _pos_y = 0.0;
@@ -197,6 +199,7 @@ void Kst2DPlot::commonConstructor(const 
                                 bool x_log,
                                 bool y_log) {
-  _oldSize.setWidth( 0 );
-  _oldSize.setHeight( 0 );
+  _dirty = true;
+  _oldSize.setWidth(0);
+  _oldSize.setHeight(0);
   _oldxAllignment = 0;
   _hasFocus = false;
@@ -3257,4 +3260,9 @@ Kst2DPlotList Kst2DPlot::globalPlotList(
 
 
+void Kst2DPlot::setDirty() {
+  _dirty = true;
+}
+
+
 #include "kst2dplot.moc"
 // vim: ts=2 sw=2 et

--- kdeextragear-2/kst/kst/kst2dplot.h  #1.48:1.49
@@ -199,4 +199,5 @@ public slots:
   void fitCurve(int id);
   void removeCurve(int id);
+  void setDirty();
   
 protected slots:
@@ -222,17 +223,4 @@ protected:
 
 private:
-  Kst2DPlotList plotList() {
-    Kst2DPlotList pl;
-    for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
-      KstSharedPtr<Kst2DPlot> p = dynamic_cast<Kst2DPlot*>((*i).data());
-      if (p) {
-        pl.append(p);
-      }
-
-      pl += (*i)->findChildrenType<Kst2DPlot>(true);
-    }
-    return pl;
-  }
-
   template<class T>
   void updateTiedPlots(void (Kst2DPlot::*method)(T), T arg, KstViewWidget *view);
@@ -268,4 +256,5 @@ private:
   bool _isTied : 1;
   bool _hasFocus : 1;
+  bool _dirty : 1;
 
   int _draggableLabel : 15; // I think this should be enough
@@ -305,5 +294,5 @@ template<class T>
 void Kst2DPlot::updateTiedPlots(void (Kst2DPlot::*method)(T), T arg, KstViewWidget *view) {
   if (isTied()) {
-    Kst2DPlotList pl = plotList();
+    Kst2DPlotList pl = globalPlotList();
 
     for (Kst2DPlotList::Iterator i = pl.begin(); i != pl.end(); ++i) {
@@ -312,5 +301,6 @@ void Kst2DPlot::updateTiedPlots(void (Ks
         (p->*method)(arg);
         p->pushScale();
-        p->cancelZoom(view);
+        //p->cancelZoom(view); // maybe we don't want to do this
+        // Too many updates happening - we have to do x-left adjustments after!
         p->update();
       }

--- kdeextragear-2/kst/kst/kstdoc.cpp  #1.91:1.92
@@ -147,10 +147,11 @@ void KstDoc::closeDocument() {
 
 bool KstDoc::newDocument() {
+  //if (KMessageBox::Yes == KMessageBox::warningYesNo(KstApp::inst(), i18n("Are you sure you wish to erase all your data and plots?"))) {
   deleteContents();
   modified = false;
   absFilePath = QDir::homeDirPath();
   title = i18n("Untitled");
-
-  createScalars( );
+    createScalars();
+  //}
 
   return true;





More information about the Kst mailing list