[gnome-bluetooth/moblin-dev] Print error if cannot set discoverable
- From: Ross Burton <rburton src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth/moblin-dev] Print error if cannot set discoverable
- Date: Thu, 25 Feb 2010 13:33:36 +0000 (UTC)
commit c82babea2016f0d7096855a2ab840a7738b7b501
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 87818e6..725b4d5 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -1620,6 +1620,7 @@ bluetooth_client_set_discoverable (BluetoothClient *client,
gboolean discoverable,
guint timeout)
{
+ GError *error = NULL;
DBusGProxy *adapter;
GValue disco = { 0 };
GValue timeoutv = { 0 };
@@ -1639,8 +1640,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);
@@ -1648,12 +1649,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);
@@ -1661,6 +1661,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]