[Kst] kdeextragear-2/kst/kst [POSSIBLY UNSAFE]

George Staikos staikos at kde.org
Wed Oct 27 17:48:51 CEST 2004


CVS commit by staikos: 

- refactor zoom code, but it appears to be -really- broken
- get rid of _ for non-member variables, and get rid of unused variables


  M +9 -11     kstdatacollection-gui.cpp   1.9 [POSSIBLY UNSAFE: printf]
  M +2 -9      kstviewobject.cpp   1.94


--- kdeextragear-2/kst/kst/kstdatacollection-gui.cpp  #1.8:1.9
@@ -81,20 +81,18 @@ int KST::vectorToFile(KstVectorPtr v, QF
   v->readLock();
 
-  int _size = v->length();
-  double *_v = v->value();
+  int vSize = v->length();
+  double *value = v->value();
   register int modval;
   QString saving = i18n("Saving vector %1").arg(v->tagName());
-  int l;
-  int rc = 0;
     
-  modval = QMAX(_size/100, 100);
+  modval = QMAX(vSize/100, 100);
 
-  app->slotUpdateProgress(_size, 0, QString::null);
+  app->slotUpdateProgress(vSize, 0, QString::null);
 
-  for (int i = 0; i < _size; i++) {
-    l = snprintf(buf, BSIZE, "%g\n", _v[i]);
+  for (int i = 0; i < vSize; i++) {
+    int l = snprintf(buf, BSIZE, "%g\n", value[i]);
     f->writeBlock(buf, l);
     if (i % modval == 0) {
-      app->slotUpdateProgress(_size, i, saving);
+      app->slotUpdateProgress(vSize, i, saving);
     }
   }
@@ -105,5 +103,5 @@ int KST::vectorToFile(KstVectorPtr v, QF
 
 #undef BSIZE
-  return rc;
+  return 0;
 }
 

--- kdeextragear-2/kst/kst/kstviewobject.cpp  #1.93:1.94
@@ -871,13 +871,6 @@ void KstViewObject::setSelected(bool sel
 
 void KstViewObject::zoom(bool zoom) {
-  if (_maximized && !zoom) {
-    _maximized = false;
-    _aspect = _aspectOldZoomedObject;
-    updateFromAspect();
-  } else if (!_maximized && zoom) {
-    _maximized = true;
-    _aspectOldZoomedObject = _aspect;
-    resizeFromAspect(0.0, 0.0, 1.0, 1.0);
-    raiseToTop();
+  if (_maximized != zoom) {
+    zoomToggle();
   }
 }





More information about the Kst mailing list