[gnome-bluetooth] applet: Fix device display regression



commit eb77b28c40cbca4b65ad307976014682091a9321
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Oct 27 20:44:27 2010 +0100

    applet: Fix device display regression
    
    With the current code, we would be showing devices that
    aren't paired, or trusted, and that are just being discovered instead.
    
    No proxy, no alias, or no Bluetooth address means we're not interested,
    just like in the old applet code.

 applet/lib/bluetooth-applet.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/applet/lib/bluetooth-applet.c b/applet/lib/bluetooth-applet.c
index 1a29c81..b2b0ea2 100644
--- a/applet/lib/bluetooth-applet.c
+++ b/applet/lib/bluetooth-applet.c
@@ -746,6 +746,18 @@ bluetooth_applet_get_devices (BluetoothApplet* self)
 				BLUETOOTH_COLUMN_TYPE, &dev->type,
 				-1);
 
+		if (proxy == NULL || dev->bdaddr == NULL || dev->alias == NULL) {
+			if (proxy != NULL)
+				g_object_unref (proxy);
+			g_strfreev (uuids);
+			if (services != NULL)
+				g_hash_table_unref (services);
+			bluetooth_simple_device_free (dev);
+
+			cont = gtk_tree_model_iter_next(self->client_model, &iter);
+			continue;
+		}
+
 		dev->device_path = g_strdup (dbus_g_proxy_get_path (proxy));
 		g_object_unref (proxy);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]