From: Kaj-Michael Lang Date: Thu, 13 Mar 2008 14:26:29 +0000 (+0200) Subject: Sigh.. use correct dbus connection for hal. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9abe7067cc8f6208c2facb1b9aa13ff85ce986b;p=mapper Sigh.. use correct dbus connection for hal. --- diff --git a/src/mapper.c b/src/mapper.c index 306d813..ae97f8b 100644 --- a/src/mapper.c +++ b/src/mapper.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -238,6 +239,10 @@ gnome_vfs_shutdown(); #ifdef WITH_OSSO osso_deinitialize(_osso); #endif +#ifdef WITH_HAL +if (ctx) + libhal_ctx_shutdown(ctx, NULL); +#endif curl_global_cleanup(); } @@ -265,9 +270,10 @@ if (strcmp(name, "ButtonPressed")==0 && strcmp(detail, "phone")==0) } static gboolean -mapper_hal_init(DBusConnection *dbc) +mapper_hal_init(DBusGConnection *gdbc) { DBusError error; +DBusConnection *dbc=dbus_g_connection_get_connection(gdbc); g_return_if_fail(dbc); @@ -276,10 +282,14 @@ dbus_error_init(&error); ctx=libhal_ctx_new(); g_return_if_fail(ctx); -libhal_ctx_set_dbus_connection(ctx, dbc); +if (!libhal_ctx_set_dbus_connection(ctx, dbc)) { + g_warning("HAL dbus connection failed"); + return FALSE; +} if (!libhal_ctx_init(ctx, &error)) { g_warning("HAL Init failed"); + ctx=NULL; return FALSE; } @@ -416,7 +426,6 @@ switch (mis) { #ifdef WITH_HAL mapper_hal_init(dbus_conn); #endif - mis=MAPPER_INIT_UI; p=0.9; w="Misc";