diff options
author | Bastien Nocera <hadess@hadess.net> | 2009-07-12 01:27:27 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2009-07-15 10:45:20 +0100 |
commit | da70a4043554cedc60132ca1ef22eeee990ddf35 (patch) | |
tree | 203bf1f0c16640a485d18e12bb7a4926ab1b7f10 /lib | |
parent | 4b3435e86c969f5f4094b8838a4bee7e933ca362 (diff) | |
download | gnome-bluetooth-da70a4043554cedc60132ca1ef22eeee990ddf35.tar.gz |
Export the error from a CreatePairedDevice call
So that the front-end can show a nice error to the user.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bluetooth-client-private.h | 5 | ||||
-rw-r--r-- | lib/bluetooth-client.c | 9 |
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/bluetooth-client-private.h b/lib/bluetooth-client-private.h index 5c0ea754..63f292e9 100644 --- a/lib/bluetooth-client-private.h +++ b/lib/bluetooth-client-private.h @@ -36,7 +36,10 @@ DBusGProxy *bluetooth_client_get_default_adapter(BluetoothClient *client); gboolean bluetooth_client_start_discovery(BluetoothClient *client); gboolean bluetooth_client_stop_discovery(BluetoothClient *client); -typedef void (*BluetoothClientCreateDeviceFunc) (BluetoothClient *client, const char *path, gpointer data); +typedef void (*BluetoothClientCreateDeviceFunc) (BluetoothClient *client, + const char *path, + const GError *error, + gpointer data); gboolean bluetooth_client_create_device(BluetoothClient *client, const char *address, const char *agent, diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c index 33f86a5a..3a0b15ab 100644 --- a/lib/bluetooth-client.c +++ b/lib/bluetooth-client.c @@ -1365,13 +1365,14 @@ static void create_device_callback(DBusGProxy *proxy, dbus_g_proxy_end_call(proxy, call, &error, DBUS_TYPE_G_OBJECT_PATH, &path, G_TYPE_INVALID); - if (error != NULL) { + if (error != NULL) path = NULL; - g_error_free(error); - } if (devdata->func) - devdata->func(devdata->client, path, devdata->data); + devdata->func(devdata->client, path, error, devdata->data); + + if (error != NULL) + g_error_free (error); g_object_unref (devdata->client); g_object_unref(proxy); |