[Bluez-devel] [PATCH] Fix bluez-gnome crash on input CreateDevice failure
From: David Woodhouse <dwmw2@infradead.org>
Date: 2007-09-22 22:55:21
Subsystem:
the rest · Maintainer:
Linus Torvalds
When we try to add an input device which already exists, the bluetooth-properties applet crashes with a dbus error. This gives a slightly nicer failure mode...
diff --git a/properties/input.c b/properties/input.c
index 7a024ae..4142df5 100644
--- a/properties/input.c
+++ b/properties/input.c@@ -56,10 +58,11 @@ static void proxy_callback(DBusGProxy *proxy, const char *path, *busname; const char *adapter = NULL, *address = NULL, *name = NULL; gchar *text; + GError *error = NULL; g_object_set_data(G_OBJECT(notebook), "call", NULL); - dbus_g_proxy_end_call(proxy, call, NULL, + dbus_g_proxy_end_call(proxy, call, &error, G_TYPE_STRING, &path, G_TYPE_INVALID); button = g_object_get_data(G_OBJECT(notebook), "cancel");
@@ -68,6 +71,15 @@ static void proxy_callback(DBusGProxy *proxy, button = g_object_get_data(G_OBJECT(notebook), "close"); gtk_widget_set_sensitive(button, TRUE); + if (error) { + label = g_object_get_data(G_OBJECT(notebook), "label"); + text = g_strdup_printf("<b>%s: %s</b>", + _("Connection failed"), error->message); + gtk_label_set_markup(GTK_LABEL(label), text); + g_free(text); + return; + } + busname = dbus_g_proxy_get_bus_name(proxy); client = dbus_g_proxy_new_for_name(connection, busname,
--
dwmw2
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel