[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Sat Jul 17 22:20:46 CEST 2004


CVS commit by staikos: 

- correct KstSharedPtr usage
- delay object construction until needed, if needed
- use const QString&
- get rid of forceRedraw since it was only used for a case that should never
  be forced anyway (no response to email about other uses)


  M +4 -4      kst2dplot.cpp   1.157
  M +1 -1      kst2dplot.h   1.66
  M +6 -12     kstplugin.cpp   1.55


--- kdeextragear-2/kst/kst/kst2dplot.cpp  #1.156:1.157
@@ -917,7 +917,7 @@ void Kst2DPlot::paint(KstPaintType type,
     p.setViewport(geometry());
     if (type == P_PRINT) {
-      draw(p, 5.0, true);
+      draw(p, 5.0);
     } else {
-      draw(p, 1.0, type == P_EXPORT);
+      draw(p, 1.0);
     }
     p.setWindow(window_hold);
@@ -975,8 +975,8 @@ void Kst2DPlot::draw() {
 }
 
-void Kst2DPlot::draw(QPainter &p, double resolutionEnhancement, bool forceDraw) {
+void Kst2DPlot::draw(QPainter &p, double resolutionEnhancement) {
   /* Draws to the buffer */
 
-  if (_zoomPaused && !forceDraw) {
+  if (_zoomPaused) {
     return;
   }

--- kdeextragear-2/kst/kst/kst2dplot.h  #1.65:1.66
@@ -211,5 +211,5 @@ public slots:
   virtual void edit();
   void draw(); // draw into back buffer
-  void draw(QPainter &p, double resolutionEnhancement = 1, bool bForceDraw = false); // This actually does the drawing
+  void draw(QPainter &p, double resolutionEnhancement = 1); // This actually does the drawing
   virtual void paint(KstPaintType type, QPainter& p);
   void editCurve(int id);

--- kdeextragear-2/kst/kst/kstplugin.cpp  #1.54:1.55
@@ -258,19 +258,13 @@ KstObject::UpdateType KstPlugin::update(
   //
   if( _plugin->data()._isFit ) {
-    KstVectorPtr  vectorParam;
-    QString       strParamName;
-    QString       strScalarName;
-    double        dScalarValue;
-    int           i;
-
-    vectorParam = _outputVectors["Parameters"];
+    KstVectorPtr vectorParam = _outputVectors["Parameters"];
     if( vectorParam ) {
-      for( i=0; i<vectorParam->length(); i++ ) {
-        strParamName = _plugin->parameterName(i);
+      for( int i=0; i<vectorParam->length(); i++ ) {
+        const QString& strParamName = _plugin->parameterName(i);
         if( !strParamName.isEmpty() ) {
-          strScalarName = i18n("%1-%2").arg(tagName()).arg(strParamName);
-          dScalarValue = vectorParam->value(i);
+          QString strScalarName = i18n("%1-%2").arg(tagName()).arg(strParamName);
+          double dScalarValue = vectorParam->value(i);
           if (!_outputScalars.contains(strParamName)) {
-            KstScalar *s = new KstScalar(strScalarName);
+            KstScalarPtr s = new KstScalar(strScalarName);
             _outputScalars.insert(strParamName, s);
           }





More information about the Kst mailing list