[Kst] Zoom code changes

Andrew Walker arwalker at sumusltd.com
Wed Oct 27 18:20:33 CEST 2004


Hi George,

Could you give more details about what you were fixing
when you modified the zoom code, and what the problems 
remaining are.

Thanks,

Andrew

-----Original Message-----
From: George Staikos [mailto:staikos at kde.org]
Sent: Wednesday, October 27, 2004 8:49 AM
To: kde-cvs at kde.org
Cc: kst at kde.org
Subject: [Kst] kdeextragear-2/kst/kst [POSSIBLY UNSAFE]


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();
   }
 }


_______________________________________________
Kst mailing list
Kst at kde.org
https://mail.kde.org/mailman/listinfo/kst




More information about the Kst mailing list