[Kst] kdeextragear-2/kst/kst/datasources/planck

George Staikos staikos at kde.org
Wed Sep 29 13:14:43 CEST 2004


CVS commit by staikos: 

cleanup


  M +2 -1      planck.cpp   1.22
  M +6 -40     planckobj.cpp   1.20


--- kdeextragear-2/kst/kst/datasources/planck/planck.cpp  #1.21:1.22
@@ -80,5 +80,6 @@ int PlanckSource::readField(double *v, c
 
   QSize sz = _planckObject->range(field);
-  long start = sz.width(), end = sz.height(), count = end - start + 1;
+  long start = sz.width(), end = sz.height();
+  long count = end - start + 1;
 
   if (s >= count) { // start past the end

--- kdeextragear-2/kst/kst/datasources/planck/planckobj.cpp  #1.19:1.20
@@ -296,5 +296,5 @@ ObjectGroup::~ObjectGroup() {
 
 void ObjectGroup::close() {
-  kdDebug () << "Close group" << endl;
+  kdDebug() << "Close group" << endl;
   if (_valid) {
     _PIOFREE(objNames);
@@ -325,4 +325,6 @@ bool ObjectGroup::updateObjectList() {
   }
 
+  _valid = false;
+
   PIOErr e = PIOGetObjectList(&objNames, &objTypes, _group);
   if (e > 0) {
@@ -339,8 +341,7 @@ bool ObjectGroup::updateObjectList() {
        - get directly only the group maximal size,
        - get the object size (it depend how KST manage index after. */
-#if 1     
-    PIOLONG LastIdx,FirstIdx;
+    PIOLONG LastIdx, FirstIdx;
     
-    PIOGetGrpSize(&FirstIdx,&LastIdx,_group);
+    PIOGetGrpSize(&FirstIdx, &LastIdx, _group);
 
     for (int i = 0; i < e; ++i) { 
@@ -348,41 +349,6 @@ bool ObjectGroup::updateObjectList() {
       lastIndex[i] = LastIdx;
     }
-#else
-    for (int i = 0; i < e; ++i) { 
-      PIOSTRING ObjName;
-      
-      /* compute the complete name of an object */
-      /* Problem : if Objectname is bigger than 128 characters TODO */
-      sprintf(ObjName, "%s/%s", _group->HTMLName,objNames[i]);
-      firstIndex[i] = PIOGetBeginObjectIdx(ObjName, 0L);
-      lastIndex[i] = PIOGetEndObjectIdx(ObjName, 0L);
-    }
-      /* remove different vectorial size and set the bigger */
-    {
-      long max_index = 0;
-      for (int i = 0; i < e; ++i) {
-        if (max_index < lastIndex[i]) {
-          max_index = lastIndex[i];
-        }
-      /* add an index if no data were not written */
-      if (max_index < 1) {
-        max_index = 1;
-      }
-      for (int i = 0; i < e; ++i) {
-        firstIndex[i] = 0;
-        lastIndex[i] = max_index;
-      }
     }
-#ifdef PIOLIBDEBUG
-      kdDebug() << "                  -> object: " << objNames[i] << endl;
-      kdDebug() << "                    -> first index: " << (long) firstIndex[i] << endl;
-      kdDebug() << "                    -> last index: " << (long) lastIndex[i] << endl;
-#endif
-
-#endif
-
-    return true;
-  }
-  return false;
+  return _valid;
 }
 





More information about the Kst mailing list