[Kst] kdeextragear-2/kst/kst/extensions/js

George Staikos staikos at kde.org
Sun Apr 17 17:54:44 CEST 2005


CVS commit by staikos: 

obey the editable flag, and new vectors need to be AVectors now


  M +5 -3      bind_vector.cpp   1.16
  M +1 -0      bind_vector.h   1.11


--- kdeextragear-2/kst/kst/extensions/js/bind_vector.cpp  #1.15:1.16
@@ -18,4 +18,5 @@
 #include "bind_vector.h"
 
+#include <kstavector.h>
 #include <kstdatacollection.h>
 
@@ -39,5 +40,5 @@ KstBindVector::KstBindVector(KJS::ExecSt
     globalObject->put(exec, "Vector", o);
   } else {
-    _v = new KstVector;
+    _v = new KstAVector(1, QString::null);
     KST::addVectorToList(_v);
   }
@@ -90,4 +91,5 @@ static VectorProperties vectorProperties
   { "newSamples", 0L, &KstBindVector::numNew },
   { "shiftedSamples", 0L, &KstBindVector::numShifted },
+  { "editable", 0L, &KstBindVector::editable },
   { 0L, 0L, 0L }
 };
@@ -197,5 +199,5 @@ KJS::Value KstBindVector::getPropertyByI
 void KstBindVector::putPropertyByIndex(KJS::ExecState *exec, unsigned propertyName, const KJS::Value &value, int attr) {
   Q_UNUSED(attr)
-  if (!_v) {
+  if (!_v || !_v->editable()) {
     KJS::Object eobj = KJS::Error::create(exec, KJS::GeneralError);
     exec->setException(eobj);
@@ -244,5 +246,5 @@ KJS::Value KstBindVector::resize(KJS::Ex
   }
 
-  if (!_v) {
+  if (!_v->editable()) {
     KJS::Object eobj = KJS::Error::create(exec, KJS::GeneralError);
     exec->setException(eobj);

--- kdeextragear-2/kst/kst/extensions/js/bind_vector.h  #1.10:1.11
@@ -57,4 +57,5 @@ class KstBindVector : public KstBinding 
     KJS::Value numNew(KJS::ExecState *exec) const;
     KJS::Value numShifted(KJS::ExecState *exec) const;
+    KJS::Value editable(KJS::ExecState *exec) const;
 
   protected:




More information about the Kst mailing list