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

Andrew Walker arwalker at sumusltd.com
Fri Jan 11 01:01:38 CET 2008


SVN commit 759640 by arwalker:

add plugin created from javaScript to global list

 M  +13 -3     kstcplugin.cpp  


--- branches/work/kst/1.6/kst/src/libkstmath/kstcplugin.cpp #759639:759640
@@ -28,6 +28,7 @@
 // application specific includes
 #include "dialoglauncher.h"
 #include "kstdatacollection.h"
+#include "kstdataobjectcollection.h"
 #include "kstdebug.h"
 #include "kstcplugin.h"
 #include "plugincollection.h"
@@ -290,9 +291,7 @@
   bool doUpdate = force;
 
   // Populate the input scalars and vectors
-  for (QValueList<Plugin::Data::IOValue>::ConstIterator it = itable.begin();
-                                                         it != itable.end();
-                                                                        ++it) {
+  for (QValueList<Plugin::Data::IOValue>::ConstIterator it = itable.begin(); it != itable.end(); ++it) {
     if ((*it)._type == Plugin::Data::IOValue::TableType) {
       if (!_inputVectors.contains((*it)._name)) {
         KstDebug::self()->log(i18n("Input vector [%1] for plugin %2 not found.  Unable to continue.").arg((*it)._name).arg(tagName()), KstDebug::Error);
@@ -572,6 +571,8 @@
           _outputScalars.clear();
           _outputStrings.clear();
 
+          freeParameters();
+
           const QValueList<Plugin::Data::IOValue>& otable = _plugin->data()._outputs;
           for (QValueList<Plugin::Data::IOValue>::ConstIterator it = otable.begin(); it != otable.end(); ++it) {
             if ((*it)._type == Plugin::Data::IOValue::TableType) {
@@ -600,6 +601,15 @@
 
           allocateParameters();
 
+          KstDataObjectList::Iterator oi = KST::dataObjectList.findTag(tagName());
+          if (oi == KST::dataObjectList.end()) {
+            KST::dataObjectList.lock().writeLock();
+            KST::dataObjectList.append(this);
+            KST::dataObjectList.lock().unlock();
+          }
+
+          setDirty(true);
+
           rc = true;
         }
       }


More information about the Kst mailing list