File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -302,6 +302,40 @@ def provide_all(self):
302302 self .decl (self .faketype (val , real ))
303303 self .to_declare .append (self .namespace + '::' + val )
304304
305+ self .both ('%s QDBusArgument& operator<<(QDBusArgument& arg, const %s &list)' %
306+ (self .visibility , val ))
307+ self .decl (';\n ' )
308+ self .impl ("""
309+ {
310+ int id = qMetaTypeId<%s>();
311+ arg.beginArray(id);
312+ for (int i = 0; i < list.count(); ++i) {
313+ arg << list.at(i);
314+ }
315+ arg.endArray();
316+ return arg;
317+ }
318+
319+ """ % (array_of ))
320+
321+ self .both ('%s const QDBusArgument& operator>>(const QDBusArgument& arg, %s &list)' %
322+ (self .visibility , val ))
323+ self .decl (';\n \n ' )
324+ self .impl ("""
325+ {
326+ arg.beginArray();
327+ list.clear();
328+ while (!arg.atEnd()) {
329+ %s item;
330+ arg >> item;
331+ list.append(item);
332+ }
333+ arg.endArray();
334+ return arg;
335+ }
336+
337+ """ % (array_of ))
338+
305339 structs = self .spec .getElementsByTagNameNS (NS_TP , 'struct' )
306340 mappings = self .spec .getElementsByTagNameNS (NS_TP , 'mapping' )
307341 exts = self .spec .getElementsByTagNameNS (NS_TP , 'external-type' )
You can’t perform that action at this time.
0 commit comments