[gnome-bluetooth] Don't stuff empty UUIDs in the model



commit c959adc48c50b7ef3a72d97c325a8d9be369d669
Author: Bastien Nocera <hadess hadess net>
Date:   Thu May 28 13:49:18 2009 +0100

    Don't stuff empty UUIDs in the model
    
    When none of the UUIDs supported by a device are interesting to us,
    don't add an empty string array into the model, stuff NULL instead.
---
 common/bluetooth-client.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/common/bluetooth-client.c b/common/bluetooth-client.c
index e85ca46..a104475 100644
--- a/common/bluetooth-client.c
+++ b/common/bluetooth-client.c
@@ -476,7 +476,10 @@ device_list_uuids (GValue *value)
 		if (uuid == NULL)
 			continue;
 		g_ptr_array_add (ret, g_strdup (uuid));
-
+	}
+	if (ret->len == 0) {
+		g_ptr_array_free (ret, TRUE);
+		return NULL;
 	}
 
 	g_ptr_array_add (ret, NULL);



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