[Kst] branches/work/kst/portto4-objectstore/kst/src

Eli Fidler eli at staikos.net
Thu Oct 18 22:45:08 CEST 2007


SVN commit 726772 by fidler:

fix DataVector API and d2asc


 M  +3 -4      d2asc/d2asc.cpp  
 M  +0 -4      libkst/datavector.cpp  
 M  +0 -1      libkst/datavector.h  
 M  +1 -1      libkstapp/vectordialog.cpp  


--- branches/work/kst/portto4-objectstore/kst/src/d2asc/d2asc.cpp #726771:726772
@@ -18,14 +18,11 @@
 #include <stdlib.h> // atoi
 #include <qsettings.h>
 
-// hack to make main() a friend of kstdatasource
-#define protected public
 #include "datavector.h"
 #include "datacollection.h"
 #include "dataobjectcollection.h"
 #include "coredocument.h"
 #include "objectstore.h"
-#undef protected
 
 static Kst::CoreDocument _document;
 
@@ -110,7 +107,9 @@
               field_list[i], filename);
       return -3;
     }
-    Kst::DataVectorPtr v = new Kst::DataVector(_document.objectStore(), Kst::ObjectTag("tag", Kst::ObjectTag::globalTagContext), file, field_list[i], start_frame, n_frames, n_skip, n_skip>0, do_ave);
+    Kst::DataVectorPtr v = _document.objectStore()->createObject<Kst::DataVector>(Kst::ObjectTag("tag", Kst::ObjectTag::globalTagContext));
+    Q_ASSERT(v);
+    v->change(file, field_list[i], start_frame, n_frames, n_skip, n_skip>0, do_ave);
     vlist.append(v);
   }
 
--- branches/work/kst/portto4-objectstore/kst/src/libkst/datavector.cpp #726771:726772
@@ -194,7 +194,6 @@
 
 
 void DataVector::change(DataSourcePtr in_file, const QString &in_field,
-                        ObjectTag in_tag,
                         int in_f0, int in_n,
                         int in_skip, bool in_DoSkip,
                         bool in_DoAve) {
@@ -212,9 +211,6 @@
   ReqF0 = in_f0;
   ReqNF = in_n;
   _field = in_field;
-  if (in_tag != tag()) {
-    setTagName(in_tag);
-  }
 
   if (_file) {
     _file->writeLock();
--- branches/work/kst/portto4-objectstore/kst/src/libkst/datavector.h #726771:726772
@@ -42,7 +42,6 @@
 
     /** change the properties of a DataVector */
     void change(DataSourcePtr file, const QString &field,
-                ObjectTag tag,
                 int f0, int n, int skip,
                 bool in_doSkip, bool in_doAve);
 
--- branches/work/kst/portto4-objectstore/kst/src/libkstapp/vectordialog.cpp #726771:726772
@@ -253,7 +253,7 @@
 //            << endl;
 
   DataVectorPtr vector = _document->objectStore()->createObject<DataVector>(tag);
-  vector->change(dataSource, field, tag,
+  vector->change(dataSource, field,
       dataRange->countFromEnd() ? -1 : int(dataRange->start()),
       dataRange->readToEnd() ? -1 : int(dataRange->range()),
       dataRange->skip(),


More information about the Kst mailing list