[gnome-bluetooth] Print error if cannot set discoverable
- From: Ross Burton <rburton src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth] Print error if cannot set discoverable
- Date: Thu, 15 Apr 2010 15:41:21 +0000 (UTC)
commit 4729b540fd3073fae8053a9856c3068c0ae7e6b4
Author: Ross Burton <ross linux intel com>
Date: Thu Feb 25 13:29:37 2010 +0000
Print error if cannot set discoverable
lib/bluetooth-client.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index 74a9d8e..22f3d4a 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -1590,6 +1590,7 @@ bluetooth_client_set_discoverable (BluetoothClient *client,
gboolean discoverable,
guint timeout)
{
+ GError *error = NULL;
DBusGProxy *adapter;
GValue disco = { 0 };
GValue timeoutv = { 0 };
@@ -1609,8 +1610,8 @@ bluetooth_client_set_discoverable (BluetoothClient *client,
g_value_set_boolean (&disco, discoverable);
g_value_set_uint (&timeoutv, timeout);
- if (discoverable) {
- ret = dbus_g_proxy_call (adapter, "SetProperty", NULL,
+ if (discoverable) {
+ ret = dbus_g_proxy_call (adapter, "SetProperty", &error,
G_TYPE_STRING, "DiscoverableTimeout",
G_TYPE_VALUE, &timeoutv,
G_TYPE_INVALID, G_TYPE_INVALID);
@@ -1618,12 +1619,11 @@ bluetooth_client_set_discoverable (BluetoothClient *client,
goto bail;
}
- ret = dbus_g_proxy_call (adapter, "SetProperty", NULL,
+ ret = dbus_g_proxy_call (adapter, "SetProperty", &error,
G_TYPE_STRING, "Discoverable",
G_TYPE_VALUE, &disco,
G_TYPE_INVALID, G_TYPE_INVALID);
- if (ret == FALSE)
- goto bail;
+
bail:
g_value_unset (&disco);
@@ -1631,6 +1631,11 @@ bail:
g_object_unref(adapter);
+ if (error) {
+ g_warning ("Cannot set discoverable: %s", error->message);
+ g_error_free (error);
+ }
+
return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]