From a24db41f217eea1cbf929cc3e623c50ca626db4b Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 21 Jan 2010 14:33:00 +0000 Subject: Pass a ready EmpathyConnectionManagers to empathy_account_assistant_show This kinda suck but we have to construct the assistant in a sync way so can't wait for the manager to become ready. --- tests/interactive/test-empathy-account-assistant.c | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/interactive/test-empathy-account-assistant.c b/tests/interactive/test-empathy-account-assistant.c index 4f1c9a49b..dc04c7027 100644 --- a/tests/interactive/test-empathy-account-assistant.c +++ b/tests/interactive/test-empathy-account-assistant.c @@ -5,19 +5,36 @@ #include #include "empathy-account-assistant.h" -int main (int argc, char **argv) +static void +managers_prepare_cb (GObject *source, + GAsyncResult *result, + gpointer user_data) { GtkWidget *assistant; + EmpathyConnectionManagers *managers = EMPATHY_CONNECTION_MANAGERS (source); - gtk_init (&argc, &argv); - empathy_gtk_init (); + g_assert (empathy_connection_managers_prepare_finish (managers, result, + NULL)); - assistant = empathy_account_assistant_show (NULL); + assistant = empathy_account_assistant_show (NULL, managers); gtk_widget_show_all (assistant); g_signal_connect_swapped (assistant, "destroy", G_CALLBACK (gtk_main_quit), NULL); +} + +int main (int argc, char **argv) +{ + EmpathyConnectionManagers *managers; + + gtk_init (&argc, &argv); + empathy_gtk_init (); + + managers = empathy_connection_managers_dup_singleton (); + + empathy_connection_managers_prepare_async (managers, + managers_prepare_cb, NULL); gtk_main (); -- cgit v1.2.3