[Kst] branches/work/kst/1.6/kst/src/libkstmath

Andrew Walker arwalker at sumusltd.com
Fri Sep 28 21:16:31 CEST 2007


SVN commit 718462 by arwalker:

add concept of optional vectors for c-style plugins

 M  +0 -1      plugin.cpp  
 M  +2 -0      plugin.h  
 M  +3 -3      pluginxmlparser.cpp  


--- branches/work/kst/1.6/kst/src/libkstmath/plugin.cpp #718461:718462
@@ -207,4 +207,3 @@
   return 0L;
 }
 
-// vim: ts=2 sw=2 et
--- branches/work/kst/1.6/kst/src/libkstmath/plugin.h #718461:718462
@@ -88,6 +88,7 @@
               PidType,
               MatrixType
             };
+
             enum ValueSubType { UnknownSubType,
               AnySubType,
               FloatSubType,
@@ -101,6 +102,7 @@
             ValueSubType _subType;
             QString _description;
             QString _default;
+            bool _optional : 1;
         };
 
         // Intro
--- branches/work/kst/1.6/kst/src/libkstmath/pluginxmlparser.cpp #718461:718462
@@ -99,6 +99,7 @@
 static const QString& QS_pid = KGlobal::staticQString("pid");
 static const QString& QS_curvehints = KGlobal::staticQString("curvehints");
 static const QString& QS_hint = KGlobal::staticQString("hint");
+static const QString& QS_optional = KGlobal::staticQString("optional");
 
 int PluginXMLParser::parseDOM(const QDomDocument& doc) {
 QDomElement topElem = doc.documentElement();
@@ -127,7 +128,7 @@
 
       if (rc < 0) {  // error occurred
         return rc;
-      }      
+      }
       n = n.nextSibling();
     }
 
@@ -335,6 +336,7 @@
       iov._name = e.attribute(QS_name);
       iov._description = e.attribute(QS_descr);
       iov._default = e.attribute(QS_default);
+      iov._optional = (bool)e.attribute(QS_optional).toInt();
       QString subtype = e.attribute(QS_type).lower();
       if (subtype == QS_float) {
         iov._subType = Plugin::Data::IOValue::FloatSubType;
@@ -434,5 +436,3 @@
 }
 #endif
 
-
-// vim: ts=2 sw=2 et


More information about the Kst mailing list