[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Sun Dec 21 09:43:40 CET 2003


CVS commit by staikos: 

enable loading and saving of filter sets and filtered vectors


  M +10 -0     filterlisteditor.ui.h   1.16
  M +25 -6     kstdoc.cpp   1.47


--- kdeextragear-2/kst/kst/filterlisteditor.ui.h  #1.15:1.16
@@ -21,4 +21,14 @@ void FilterListEditor::init()
 void FilterListEditor::update()
 {
+    QString cur = _select->currentText();
+    _select->clear();
+    for (KstFilterSetList::Iterator it = KST::filterSetList.begin(); it != KST::filterSetList.end(); ++it) {
+        _select->insertItem((*it)->name());
+    }
+
+    if (!cur.isEmpty()) {
+      _select->setCurrentText(cur);
+    }
+
     _filters->clear();
     PluginCollection *pc = PluginCollection::self();

--- kdeextragear-2/kst/kst/kstdoc.cpp  #1.46:1.47
@@ -50,13 +50,14 @@
 
 // application specific includes
-#include "kstdoc.h"
-#include "kstpoint.h"
-#include "kstplugin.h"
 #include "kst.h"
-#include "kstvcurve.h"
-#include "kstpsdcurve.h"
+#include "kstdatacollection.h"
+#include "kstdoc.h"
 #include "kstequationcurve.h"
+#include "kstfilteredvector.h"
 #include "ksthistogram.h"
-#include "kstdatacollection.h"
+#include "kstplugin.h"
+#include "kstpoint.h"
+#include "kstpsdcurve.h"
+#include "kstvcurve.h"
 
 static bool backupFile(const QString& qFilename, const QString& backupDir = QString::null, const QString& backupExtension = "~");
@@ -215,4 +216,8 @@ bool KstDoc::openDocument(const KURL &ur
         vector = new KstRVector(e, o_file, o_n, o_f, o_s, o_ave);
         // Vectors are automatically added to the global list.
+      } else if (e.tagName() == "filterset") {
+        KST::filterSetList.append(new KstFilterSet(e));
+      } else if (e.tagName() == "filteredvector") {
+        KST::vectorList.append(new KstFilteredVector(e));
       } else if (e.tagName() == "plugin") {
         KST::dataObjectList.append(new KstPlugin(e));
@@ -299,4 +304,18 @@ bool KstDoc::saveDocument(const QString 
   }
 
+  // save filters
+  for (KstFilterSetList::Iterator it = KST::filterSetList.begin(); it != KST::filterSetList.end(); ++it) {
+    ts << " <filterset>" << endl;
+    (*it)->save(ts);
+    ts << " </filterset>" << endl;
+  }
+
+  KstFilteredVectorList fvl = kstObjectSubList<KstVector,KstFilteredVector>(KST::vectorList);
+  for (KstFilteredVectorList::Iterator it = fvl.begin(); it != fvl.end(); ++it) {
+    ts << " <filteredvector>" << endl;
+    (*it)->save(ts);
+    ts << " </filteredvector>" << endl;
+  }
+
   // save plots
   for (i = 0; i < (int)KST::plotList.count(); i++) {





More information about the Kst mailing list