summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2012-02-01 16:07:25 -0500
committerJonny Lamb <jonny.lamb@collabora.co.uk>2012-02-01 16:07:25 -0500
commitab745cbdead64a313fe3e8859cec5bf7c4382dc9 (patch)
tree024c6049bdae369f8833b02c0c5ed38691bbf419 /plugins
parent1d41beb99b03f828fd204e6e18fa7499360937b9 (diff)
Revert "Merge remote-tracking branch 'siraj/plugin-api-change'"
Diffstat (limited to 'plugins')
-rw-r--r--plugins/console.c31
-rw-r--r--plugins/gateways.c31
-rw-r--r--plugins/test.c33
3 files changed, 18 insertions, 77 deletions
diff --git a/plugins/console.c b/plugins/console.c
index 8d6795c9d..13ca0eccf 100644
--- a/plugins/console.c
+++ b/plugins/console.c
@@ -77,7 +77,7 @@ gabble_console_plugin_class_init (GabbleConsolePluginClass *klass)
}
static void
-gabble_console_plugin_create_sidecar_async (
+gabble_console_plugin_create_sidecar (
GabblePlugin *plugin,
const gchar *sidecar_interface,
GabbleConnection *connection,
@@ -87,7 +87,10 @@ gabble_console_plugin_create_sidecar_async (
{
GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (plugin),
callback, user_data,
- gabble_console_plugin_create_sidecar_async);
+ /* sic: all plugins share gabble_plugin_create_sidecar_finish() so we
+ * need to use the same source tag.
+ */
+ gabble_plugin_create_sidecar);
GabbleSidecar *sidecar = NULL;
if (!tp_strdiff (sidecar_interface, GABBLE_IFACE_GABBLE_PLUGIN_CONSOLE))
@@ -111,27 +114,6 @@ gabble_console_plugin_create_sidecar_async (
g_object_unref (result);
}
-static GabbleSidecar *
-gabble_console_plugin_create_sidecar_finish (
- GabblePlugin *plugin,
- GAsyncResult *result,
- GError **error)
-{
- GabbleSidecar *sidecar;
-
- if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result),
- error))
- return NULL;
-
- g_return_val_if_fail (g_simple_async_result_is_valid (result,
- G_OBJECT (plugin), gabble_console_plugin_create_sidecar_async), NULL);
-
- sidecar = GABBLE_SIDECAR (g_simple_async_result_get_op_res_gpointer (
- G_SIMPLE_ASYNC_RESULT (result)));
-
- return g_object_ref (sidecar);
-}
-
static void
plugin_iface_init (
gpointer g_iface,
@@ -142,8 +124,7 @@ plugin_iface_init (
iface->name = "XMPP console";
iface->version = PACKAGE_VERSION;
iface->sidecar_interfaces = sidecar_interfaces;
- iface->create_sidecar_async = gabble_console_plugin_create_sidecar_async;
- iface->create_sidecar_finish = gabble_console_plugin_create_sidecar_finish;
+ iface->create_sidecar = gabble_console_plugin_create_sidecar;
}
GabblePlugin *
diff --git a/plugins/gateways.c b/plugins/gateways.c
index 1e7b141a2..88a32223f 100644
--- a/plugins/gateways.c
+++ b/plugins/gateways.c
@@ -75,7 +75,7 @@ gabble_gateway_plugin_class_init (GabbleGatewayPluginClass *klass)
}
static void
-gabble_gateway_plugin_create_sidecar_async (
+gabble_gateway_plugin_create_sidecar (
GabblePlugin *plugin,
const gchar *sidecar_interface,
GabbleConnection *connection,
@@ -85,7 +85,10 @@ gabble_gateway_plugin_create_sidecar_async (
{
GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (plugin),
callback, user_data,
- gabble_gateway_plugin_create_sidecar_async);
+ /* sic: all plugins share gabble_plugin_create_sidecar_finish() so we
+ * need to use the same source tag.
+ */
+ gabble_plugin_create_sidecar);
GabbleSidecar *sidecar = NULL;
if (!tp_strdiff (sidecar_interface, GABBLE_IFACE_GABBLE_PLUGIN_GATEWAYS))
@@ -109,27 +112,6 @@ gabble_gateway_plugin_create_sidecar_async (
g_object_unref (result);
}
-static GabbleSidecar *
-gabble_gateway_plugin_create_sidecar_finish (
- GabblePlugin *plugin,
- GAsyncResult *result,
- GError **error)
-{
- GabbleSidecar *sidecar;
-
- if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result),
- error))
- return NULL;
-
- g_return_val_if_fail (g_simple_async_result_is_valid (result,
- G_OBJECT (plugin), gabble_gateway_plugin_create_sidecar_async), NULL);
-
- sidecar = GABBLE_SIDECAR (g_simple_async_result_get_op_res_gpointer (
- G_SIMPLE_ASYNC_RESULT (result)));
-
- return g_object_ref (sidecar);
-}
-
static void
plugin_iface_init (
gpointer g_iface,
@@ -140,8 +122,7 @@ plugin_iface_init (
iface->name = "Gateway registration plugin";
iface->version = PACKAGE_VERSION;
iface->sidecar_interfaces = sidecar_interfaces;
- iface->create_sidecar_async = gabble_gateway_plugin_create_sidecar_async;
- iface->create_sidecar_finish = gabble_gateway_plugin_create_sidecar_finish;
+ iface->create_sidecar = gabble_gateway_plugin_create_sidecar;
}
GabblePlugin *
diff --git a/plugins/test.c b/plugins/test.c
index 43b18ea3b..05d784052 100644
--- a/plugins/test.c
+++ b/plugins/test.c
@@ -80,7 +80,7 @@ sidecar_iq_created_cb (
}
static void
-test_plugin_create_sidecar_async (
+test_plugin_create_sidecar (
GabblePlugin *plugin,
const gchar *sidecar_interface,
GabbleConnection *connection,
@@ -90,8 +90,10 @@ test_plugin_create_sidecar_async (
{
GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (plugin),
callback, user_data,
- test_plugin_create_sidecar_async);
-
+ /* sic: all plugins share gabble_plugin_create_sidecar_finish() so we
+ * need to use the same source tag.
+ */
+ gabble_plugin_create_sidecar);
GabbleSidecar *sidecar = NULL;
if (!tp_strdiff (sidecar_interface, IFACE_TEST))
@@ -122,31 +124,9 @@ test_plugin_create_sidecar_async (
g_simple_async_result_set_op_res_gpointer (result, sidecar, g_object_unref);
g_simple_async_result_complete_in_idle (result);
-
g_object_unref (result);
}
-static GabbleSidecar *
-test_plugin_create_sidecar_finish (
- GabblePlugin *plugin,
- GAsyncResult *result,
- GError **error)
-{
- GabbleSidecar *sidecar;
-
- if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result),
- error))
- return NULL;
-
- g_return_val_if_fail (g_simple_async_result_is_valid (result,
- G_OBJECT (plugin), test_plugin_create_sidecar_async), NULL);
-
- sidecar = GABBLE_SIDECAR (g_simple_async_result_get_op_res_gpointer (
- G_SIMPLE_ASYNC_RESULT (result)));
-
- return g_object_ref (sidecar);
-}
-
static GPtrArray *
test_plugin_create_channel_managers (GabblePlugin *plugin,
TpBaseConnection *connection)
@@ -184,8 +164,7 @@ plugin_iface_init (
iface->name = "Sidecar test plugin";
iface->version = PACKAGE_VERSION;
iface->sidecar_interfaces = sidecar_interfaces;
- iface->create_sidecar_async = test_plugin_create_sidecar_async;
- iface->create_sidecar_finish = test_plugin_create_sidecar_finish;
+ iface->create_sidecar = test_plugin_create_sidecar;
iface->create_channel_managers = test_plugin_create_channel_managers;
iface->presence_statuses = test_presences;