From ed8163b9de3adf9883b2cf0c47c35bad2fe221ff Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Jul 2010 20:58:38 -0500 Subject: Making the registration async to clean things up, and async is better anyway. --- tests/test-approver.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/test-approver.c b/tests/test-approver.c index df06df2..fd90bf7 100644 --- a/tests/test-approver.c +++ b/tests/test-approver.c @@ -66,6 +66,21 @@ _notification_approver_server_approve_item (void) return; } +static void +register_cb (DBusGProxy * proxy, GError * error, gpointer user_data) +{ + if (error != NULL) { + g_warning("Unable to register approver: %s", error->message); + g_error_free(error); + g_main_loop_quit(main_loop); + return; + } + + g_debug("Building App Indicator"); + + return; +} + gint owner_count = 0; gboolean check_for_service (gpointer user_data) @@ -91,14 +106,7 @@ check_for_service (gpointer user_data) NOTIFICATION_WATCHER_DBUS_IFACE); g_debug("Registering Approver"); - GError * error = NULL; - org_kde_StatusNotifierWatcher_register_notification_approver (proxy, APPROVER_PATH, &cats, &error); - - if (error != NULL) { - g_warning("Unable to register approver: %s", error->message); - g_error_free(error); - g_main_loop_quit(main_loop); - } + org_kde_StatusNotifierWatcher_register_notification_approver_async (proxy, APPROVER_PATH, &cats, register_cb, NULL); return FALSE; } -- cgit v1.2.3