Browse Source

invalidate property added to QXmlQuery script binding

Neal Wilson 11 years ago
parent
commit
d9ea878e73
2 changed files with 11 additions and 1 deletions
  1. 1
    0
      config/Windows/batchdetailsnew.xml
  2. 10
    1
      src/typica.w

+ 1
- 0
config/Windows/batchdetailsnew.xml View File

295
 				rq = rq + 'string($t/annotation), "~")';
295
 				rq = rq + 'string($t/annotation), "~")';
296
 				colQuery.setQuery(rq);
296
 				colQuery.setQuery(rq);
297
 				var annotationData = colQuery.exec();
297
 				var annotationData = colQuery.exec();
298
+				colQuery = colQuery.invalidate();
298
 				buffer2.close();
299
 				buffer2.close();
299
 				output.writeStartElement("tbody");
300
 				output.writeStartElement("tbody");
300
 				var annotationRecords = annotationData.split("~");
301
 				var annotationRecords = annotationData.split("~");

+ 10
- 1
src/typica.w View File

2256
 QScriptValue XQuery_bind(QScriptContext *context, QScriptEngine *engine);
2256
 QScriptValue XQuery_bind(QScriptContext *context, QScriptEngine *engine);
2257
 QScriptValue XQuery_exec(QScriptContext *context, QScriptEngine *engine);
2257
 QScriptValue XQuery_exec(QScriptContext *context, QScriptEngine *engine);
2258
 QScriptValue XQuery_setQuery(QScriptContext *context, QScriptEngine *engine);
2258
 QScriptValue XQuery_setQuery(QScriptContext *context, QScriptEngine *engine);
2259
+QScriptValue XQuery_invalidate(QScriptContext *context, QScriptEngine *engine);
2259
 void setXQueryProperties(QScriptValue value, QScriptEngine *engine);
2260
 void setXQueryProperties(QScriptValue value, QScriptEngine *engine);
2260
 
2261
 
2261
 @ The constructor must be registered with the host environment. This is done a
2262
 @ The constructor must be registered with the host environment. This is done a
2266
 engine->globalObject().setProperty("XQuery", constructor);
2267
 engine->globalObject().setProperty("XQuery", constructor);
2267
 
2268
 
2268
 @ The constructor just needs to make sure the functions we want to make
2269
 @ The constructor just needs to make sure the functions we want to make
2269
-available are applied.
2270
+available are applied. A method is also provided to free the |QXmlQuery|.
2270
 
2271
 
2271
 @<Functions for scripting@>=
2272
 @<Functions for scripting@>=
2272
 QScriptValue constructXQuery(QScriptContext *, QScriptEngine *engine)
2273
 QScriptValue constructXQuery(QScriptContext *, QScriptEngine *engine)
2276
 	return object;
2277
 	return object;
2277
 }
2278
 }
2278
 
2279
 
2280
+QScriptValue XQuery_invalidate(QScriptContext *context, QScriptEngine *)
2281
+{
2282
+	QXmlQuery *self = getself<QXmlQuery *>(context);
2283
+	delete self;
2284
+	return QScriptValue();
2285
+}
2286
+
2279
 void setXQueryProperties(QScriptValue value, QScriptEngine *engine)
2287
 void setXQueryProperties(QScriptValue value, QScriptEngine *engine)
2280
 {
2288
 {
2281
 	value.setProperty("bind", engine->newFunction(XQuery_bind));
2289
 	value.setProperty("bind", engine->newFunction(XQuery_bind));
2282
 	value.setProperty("exec", engine->newFunction(XQuery_exec));
2290
 	value.setProperty("exec", engine->newFunction(XQuery_exec));
2283
 	value.setProperty("setQuery", engine->newFunction(XQuery_setQuery));
2291
 	value.setProperty("setQuery", engine->newFunction(XQuery_setQuery));
2292
+	value.setProperty("invalidate", engine->newFunction(XQuery_invalidate));
2284
 }
2293
 }
2285
 
2294
 
2286
 @ The |bind()| property can be used to specify a |QIODevice| to be referenced by
2295
 @ The |bind()| property can be used to specify a |QIODevice| to be referenced by

Loading…
Cancel
Save