KJS::Value KstBindDataSource::metaData(KJS::ExecState *exec) const {
  KJS::Object array(exec->interpreter()->builtinArray().construct(exec, 0));
  KstDataSourcePtr s = makeSource(_d);
  if (s) {
    s->readLock();
    QDict<KstString> data = s->metaData();
    s->unlock();
    for (QDictIterator<KstString> i(data); i.current(); ++i) {
      array.put(exec, KJS::Identifier(i.currentKey().latin1()), KJS::String(i.current() ? i.current()->value() : QString::null));
    }
  }
  return array;
}
示例#2
0
KJS::Value KstBindDataSource::metaData(KJS::ExecState *exec) const {
  KJS::Object array(exec->interpreter()->builtinArray().construct(exec, 0));
  KstDataSourcePtr s = makeSource(_d);
  if (s) {
    s->readLock();
    QMap<QString,QString> data = s->metaData();
    s->readUnlock();
    for (QMap<QString,QString>::ConstIterator i = data.begin(); i != data.end(); ++i) {
      array.put(exec, KJS::Identifier(i.key().latin1()), KJS::String(i.data()));
    }
  }
  return array;
}