In tp-glib, python environment, calling list_connection_managers; it passes to the callback cms, n_cms and others. (see URL for spec).
n_cms is passed with the correct value, however cms is passed as an empty list.
(In reply to comment #0)
> n_cms is passed with the correct value, however cms is passed as an empty list.
I think the right solution for this is to add a tp_list_connection_managers_async()/tp_list_connection_managers_finish() pair which is nicely introspectable and does sensible things (use GAsyncResult, etc.), and eventually deprecate/remove tp_list_connection_managers.
(Also, we can take this opportunity to make it always-async, i.e. guarantee to call the callback from the main loop, and never be re-entrant.)
I've written a simple tp_list_connection_managers_async() in terms of tp_list_connection_managers(), but they should probably have common code rather than one calling the other.
Also, we need to decide what _finish() returns in C - GList? GPtrArray? (transfer container)? (transfer full)? See Bug #39189.
Created attachment 58163 [details] [review]
[01/10] Expect to find service files in the srcdir, not the builddir
This fixes the /cm/list test in out-of-tree builds, or rather, would
fix it if that test had ever worked (which is fixed by the next commit).
Created attachment 58164 [details] [review]
[02/10] tests/dbus/cm: actually run the test that lists connection managers
It turns out this was my fault, back in 2009. Oops.
Created attachment 58165 [details] [review]
[03/10] cm test: free things in a less verbose way
Created attachment 58166 [details] [review]
[04/10] CM test: after listing CMs, inspect them in the test, not the callback
This will make it easier to re-use the same test for different ways to
Created attachment 58167 [details] [review]
[05/10] _tp_object_list_copy, _tp_object_list_free: add
Created attachment 58168 [details] [review]
[06/10] tp_list_connection_managers_async: add
This is a modern, bindable version of tp_list_connection_managers(),
which has been noted not to work in Python.
Created attachment 58169 [details] [review]
[07/10] Test listing CMs the new way
Created attachment 58170 [details] [review]
[08/10] tp_protocol_dup_params, tp_protocol_dup_param, tp_protocol_borrow_params: add
tp_protocol_dup_params might be less nice for C (you have to free the
list and the items), but is definitely nicer for Python and other g-i
bindings. It will probably be renamed to ...get_params in Telepathy 1.0.
tp_protocol_borrow_params is an efficient "C binding", but not as GObject'y.
tp_protocol_dup_param will replace get_param in Telepathy 1.0.
Created attachment 58171 [details] [review]
[09/10] tp_connection_manager_dup_protocols: add
Again, this provides a more introspectable way to get the protocols.
Combining dup_protocol_names() and get_protocol() is more type-safe,
but less obvious.
Created attachment 58172 [details] [review]
[10/10] Add a Python example which lists and inspects protocols with g-i
I could get used to this "rapid prototyping in Python" thing.
This all looks good.
Was fixed in 0.17.6