[gnome-bluetooth] Export the LegacyPairing property for devices
- From: Bastien Nocera <hadess src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-bluetooth] Export the LegacyPairing property for devices
- Date: Mon, 8 Jun 2009 09:12:13 -0400 (EDT)
commit 1c8efe6f0a51477aac4a0b149cd8b8f3644aaef0
Author: Bastien Nocera <hadess hadess net>
Date: Mon Jun 8 14:11:23 2009 +0100
Export the LegacyPairing property for devices
If FALSE, then we can assume a device with Simple Pairing support.
---
common/bluetooth-client.c | 9 +++++++--
common/bluetooth-client.h | 1 +
common/test-client.c | 4 ++++
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/common/bluetooth-client.c b/common/bluetooth-client.c
index 11c8300..1089e62 100644
--- a/common/bluetooth-client.c
+++ b/common/bluetooth-client.c
@@ -554,7 +554,7 @@ static void add_device(DBusGProxy *adapter, GtkTreeIter *parent,
const gchar *address, *alias, *name, *icon;
char **uuids;
GHashTable *services;
- gboolean paired, trusted, connected;
+ gboolean paired, trusted, connected, legacypairing;
guint type;
gint rssi;
GtkTreeIter iter;
@@ -601,6 +601,9 @@ static void add_device(DBusGProxy *adapter, GtkTreeIter *parent,
value = g_hash_table_lookup(hash, "UUIDs");
uuids = device_list_uuids (value);
+
+ value = g_hash_table_lookup(hash, "LegacyPairing");
+ legacypairing = value ? g_value_get_boolean(value) : TRUE;
} else {
if (device)
g_object_unref (device);
@@ -625,6 +628,7 @@ static void add_device(DBusGProxy *adapter, GtkTreeIter *parent,
BLUETOOTH_COLUMN_ICON, icon,
BLUETOOTH_COLUMN_RSSI, rssi,
BLUETOOTH_COLUMN_UUIDS, uuids,
+ BLUETOOTH_COLUMN_LEGACYPAIRING, legacypairing,
-1);
if (device != NULL) {
@@ -661,6 +665,7 @@ static void add_device(DBusGProxy *adapter, GtkTreeIter *parent,
BLUETOOTH_COLUMN_CONNECTED, connected,
BLUETOOTH_COLUMN_SERVICES, services,
BLUETOOTH_COLUMN_UUIDS, uuids,
+ BLUETOOTH_COLUMN_LEGACYPAIRING, legacypairing,
-1);
done:
@@ -966,7 +971,7 @@ static void bluetooth_client_init(BluetoothClient *client)
G_TYPE_UINT, G_TYPE_STRING, G_TYPE_INT,
G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
- G_TYPE_HASH_TABLE, G_TYPE_STRV);
+ G_TYPE_BOOLEAN, G_TYPE_HASH_TABLE, G_TYPE_STRV);
priv->dbus = dbus_g_proxy_new_for_name(connection, DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS);
diff --git a/common/bluetooth-client.h b/common/bluetooth-client.h
index 62a1a4b..70f3ee5 100644
--- a/common/bluetooth-client.h
+++ b/common/bluetooth-client.h
@@ -44,6 +44,7 @@ typedef enum {
BLUETOOTH_COLUMN_TRUSTED,
BLUETOOTH_COLUMN_CONNECTED,
BLUETOOTH_COLUMN_DISCOVERING,
+ BLUETOOTH_COLUMN_LEGACYPAIRING,
BLUETOOTH_COLUMN_POWERED,
BLUETOOTH_COLUMN_SERVICES,
BLUETOOTH_COLUMN_UUIDS,
diff --git a/common/test-client.c b/common/test-client.c
index a948738..02f3862 100644
--- a/common/test-client.c
+++ b/common/test-client.c
@@ -227,6 +227,10 @@ static void create_window(void)
"text", BLUETOOTH_COLUMN_CONNECTED, NULL);
gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(tree), -1,
+ "Legacy Pairing", gtk_cell_renderer_text_new(),
+ "text", BLUETOOTH_COLUMN_LEGACYPAIRING, NULL);
+
+ gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(tree), -1,
"Discovering", gtk_cell_renderer_text_new(),
"text", BLUETOOTH_COLUMN_DISCOVERING, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]