[Kst] kdeextragear-2/kst/kst/extensions/js
George Staikos
staikos at kde.org
Tue Mar 29 21:50:07 CEST 2005
CVS commit by staikos:
make the properties show up (to be refactored again)
M +23 -0 bind_datavector.cpp 1.5
M +3 -0 bind_datavector.h 1.5
--- kdeextragear-2/kst/kst/extensions/js/bind_datavector.cpp #1.4:1.5
@@ -197,4 +197,27 @@ static VProperties Properties[] = {
+KJS::ReferenceList KstBindDataVector::propList(KJS::ExecState *exec, bool recursive) {
+ KJS::ReferenceList rc = KstBinding::propList(exec, recursive);
+
+ for (int i = 0; Properties[i].name; ++i) {
+ rc.append(KJS::Reference(this, KJS::Identifier(Properties[i].name)));
+ }
+
+ return rc;
+}
+
+
+bool KstBindDataVector::hasProperty(KJS::ExecState *exec, const KJS::Identifier& propertyName) const {
+ QString prop = propertyName.qstring();
+ for (int i = 0; Properties[i].name; ++i) {
+ if (prop == Properties[i].name) {
+ return true;
+ }
+ }
+
+ return KstBinding::hasProperty(exec, propertyName);
+}
+
+
void KstBindDataVector::put(KJS::ExecState *exec, const KJS::Identifier& propertyName, const KJS::Value& value, int attr) {
if (!_v) {
--- kdeextragear-2/kst/kst/extensions/js/bind_datavector.h #1.4:1.5
@@ -38,4 +38,7 @@ class KstBindDataVector : public KstBind
KJS::Value get(KJS::ExecState *exec, const KJS::Identifier& propertyName) const;
void put(KJS::ExecState *exec, const KJS::Identifier& propertyName, const KJS::Value& value, int attr = KJS::None);
+ KJS::ReferenceList propList(KJS::ExecState *exec, bool recursive = true);
+ bool hasProperty(KJS::ExecState *exec, const KJS::Identifier& propertyName) const;
+
// member functions
More information about the Kst
mailing list