GNOME Bugzilla – Bug 674206
Add helper macro to implement _finish() methods
Last modified: 2012-10-10 22:41:38 UTC
telepathy-glib has _tp_implement_finish_void() and friends to implement _finish() functions in one line. I think they should be moved to gio's public API. http://cgit.collabora.com/git/user/xclaesse/telepathy-glib.git/tree/telepathy-glib/util-internal.h#n52 If people agree on the idea, I could prepare a patch.
Actually link on the official repository instead of mine: http://cgit.freedesktop.org/telepathy/telepathy-glib/tree/telepathy-glib/util-internal.h#n52
GTask in bug 661767 (which I'm hoping to land soon, after glib branches) makes finish functions a lot simpler, so this would be less necessary. Eg, you'd have: GList * tp_list_connection_managers_finish (GAsyncResult *result, GError **error) { g_return_val_if_fail (g_task_is_valid (result, NULL), NULL); return g_task_propagate_pointer (G_TASK (result), error); } where g_task_propagate_pointer() either steals the return value from @result (making it unnecessary to do an extra copy), or else fills in @error with an error and returns NULL.
Ok makes sense. Closing.