[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Thu May 22 05:35:35 CEST 2003
CVS commit by staikos:
call the plugins
M +16 -10 kstplugin.cpp 1.9
--- kdeextragear-2/kst/kst/kstplugin.cpp #1.8:1.9
@@ -22,4 +22,6 @@
#include <klocale.h>
+#include <stdlib.h>
+
KstPlugin::KstPlugin() {
@@ -57,5 +59,4 @@ KstPlugin::KstPlugin(QDomElement &e, con
void KstPlugin::commonConstructor() {
- Tag = QString::null;
_plugin = 0L;
kdDebug() << "Creating KSTPlugin: " << long(this) << endl;
@@ -70,4 +71,7 @@ KstPlugin::~KstPlugin() {
static void countScalarsAndVectors(const QValueList<Plugin::Data::IOValue>& table, unsigned& scalars, unsigned& vectors)
{
+ scalars = 0;
+ vectors = 0;
+
for (QValueList<Plugin::Data::IOValue>::ConstIterator it = table.begin(); it != table.end(); ++it) {
switch ((*it)._type) {
@@ -88,10 +92,11 @@ static void countScalarsAndVectors(const
void KstPlugin::update(int update_counter) {
- if (!_plugin.data()) {
+ if (!_plugin.data() || update_counter == LastUpdateCounter) {
return;
}
- if (update_counter == LastUpdateCounter) return;
- if (update_counter>0) LastUpdateCounter = update_counter;
+ if (update_counter > 0) {
+ LastUpdateCounter = update_counter;
+ }
int *inArrayLens = 0L, *outArrayLens = 0L;
@@ -128,11 +133,9 @@ void KstPlugin::update(int update_counte
}
- // FIXME: how are output arrays allocated?
-
for (unsigned i = 0; i < outArrayCnt; i++) {
- outArrayLens[i] = -1;
+ outVectors[i] = static_cast<double*>(malloc(sizeof(double)));
+ outArrayLens[i] = 1;
}
-#if 0
int rc = _plugin->call(inVectors, inArrayLens, inScalars,
outVectors, outArrayLens, outScalars);
@@ -141,7 +144,10 @@ void KstPlugin::update(int update_counte
// Error
}
-#endif
- // FIXME: delete output arrays
+ // FIXME: do something with the output
+
+ for (unsigned i = 0; i < outArrayCnt; i++) {
+ free(outVectors[i]);
+ }
for (unsigned i = 0; i < inArrayCnt; i++) {
More information about the Kst
mailing list