zeitgeist team mailing list archive
-
zeitgeist team
-
Mailing list archive
-
Message #04226
[Branch ~zeitgeist/zeitgeist/bluebird] Rev 287: Fix the marshalling mess
------------------------------------------------------------
revno: 287
committer: Michal Hruby <michal.mhr@xxxxxxxxx>
branch nick: bb-fts
timestamp: Mon 2011-10-10 00:25:45 +0200
message:
Fix the marshalling mess
modified:
extensions/fts.vala
--
lp:~zeitgeist/zeitgeist/bluebird
https://code.launchpad.net/~zeitgeist/zeitgeist/bluebird
Your team Zeitgeist Framework Team is subscribed to branch lp:~zeitgeist/zeitgeist/bluebird.
To unsubscribe from this branch go to https://code.launchpad.net/~zeitgeist/zeitgeist/bluebird/+edit-subscription
=== modified file 'extensions/fts.vala'
--- extensions/fts.vala 2011-10-09 19:49:34 +0000
+++ extensions/fts.vala 2011-10-09 22:25:45 +0000
@@ -27,7 +27,8 @@
string query_string,
[DBus (signature = "(xx)")] Variant time_range,
[DBus (signature = "a(asaasay)")] Variant filter_templates,
- uint offset, uint count, uint result_type) throws Error;
+ uint offset, uint count, uint result_type,
+ [DBus (signature = "a(asaasay)")] out Variant events) throws Error;
}
/* Because of a Vala bug we have to define the proxy interface outside of
@@ -75,14 +76,31 @@
}
}
+ /* This whole method is one huge workaround for an issue with Vala
+ * enclosing all out/return parameters in a TUPLE variant */
public async Variant search (string query_string, Variant time_range,
- Variant filter_templates, uint offset, uint count, uint result_type)
- throws Error
+ Variant filter_templates, uint offset, uint count, uint result_type,
+ out Variant events) throws Error
{
- debug ("Searching for '%s'", query_string);
+ DBusProxy proxy = (DBusProxy) siin;
+ var b = new VariantBuilder (new VariantType ("(s(xx)a(asaasay)uuu)"));
+ b.add ("s", query_string);
+ b.add_value (time_range);
+ b.add_value (filter_templates);
+ b.add ("u", offset);
+ b.add ("u", count);
+ b.add ("u", result_type);
+ var result = yield proxy.call ("Search", b.end (), 0, -1, null);
+ debug ("%s: %s", Log.METHOD, result.get_type_string ());
+ events = result.get_child_value (0);
+ /* FIXME: this somehow doesn't work :(
+ * but it's fixable in a similar way as this method's signature
+ * is done */
+ /*
var result = yield siin.search (query_string, time_range,
filter_templates, offset, count, result_type);
- return result;
+ */
+ return result.get_child_value (1);
}
}