All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/2] core: Fix leftover signal for UUIDs property
@ 2012-12-14 14:13 Lucas De Marchi
  2012-12-14 14:13 ` [PATCH BlueZ 2/2] core: Remove unused emit_array_property_changed function Lucas De Marchi
  2012-12-16 11:25 ` [PATCH BlueZ 1/2] core: Fix leftover signal for UUIDs property Johan Hedberg
  0 siblings, 2 replies; 3+ messages in thread
From: Lucas De Marchi @ 2012-12-14 14:13 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Lucas De Marchi

---
 src/device.c | 28 ++++++++--------------------
 1 file changed, 8 insertions(+), 20 deletions(-)

diff --git a/src/device.c b/src/device.c
index 01c40a7..714fc72 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2442,23 +2442,6 @@ static void device_remove_profiles(struct btd_device *device, GSList *uuids)
 	}
 }
 
-static void uuids_changed(struct btd_device *device)
-{
-	char **uuids;
-	GSList *l;
-	int i;
-
-	uuids = g_new0(char *, g_slist_length(device->uuids) + 1);
-	for (i = 0, l = device->uuids; l; l = l->next, i++)
-		uuids[i] = l->data;
-
-	emit_array_property_changed(device->path,
-					DEVICE_INTERFACE, "UUIDs",
-					DBUS_TYPE_STRING, &uuids, i);
-
-	g_free(uuids);
-}
-
 static void store_sdp_record(GKeyFile *key_file, sdp_record_t *rec)
 {
 	char handle_str[11];
@@ -2803,7 +2786,9 @@ static void search_cb(sdp_list_t *recs, int err, gpointer user_data)
 		device_remove_profiles(device, req->profiles_removed);
 
 	/* Propagate services changes */
-	uuids_changed(req->device);
+	g_dbus_emit_property_changed(btd_get_dbus_connection(),
+					req->device->path, DEVICE_INTERFACE,
+					"UUIDs");
 
 send_reply:
 	device_svc_resolved(device, err);
@@ -2966,7 +2951,8 @@ static void register_all_services(struct browse_req *req, GSList *services)
 	if (device->attios == NULL && device->attios_offline == NULL)
 		attio_cleanup(device);
 
-	uuids_changed(device);
+	g_dbus_emit_property_changed(btd_get_dbus_connection(), device->path,
+						DEVICE_INTERFACE, "UUIDs");
 
 	device_svc_resolved(device, 0);
 
@@ -4057,7 +4043,9 @@ void btd_device_add_uuid(struct btd_device *device, const char *uuid)
 	g_slist_free(uuid_list);
 
 	store_device_info(device);
-	uuids_changed(device);
+
+	g_dbus_emit_property_changed(btd_get_dbus_connection(), device->path,
+						DEVICE_INTERFACE, "UUIDs");
 }
 
 static sdp_list_t *read_device_records(struct btd_device *device)
-- 
1.8.0.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-12-16 11:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-14 14:13 [PATCH BlueZ 1/2] core: Fix leftover signal for UUIDs property Lucas De Marchi
2012-12-14 14:13 ` [PATCH BlueZ 2/2] core: Remove unused emit_array_property_changed function Lucas De Marchi
2012-12-16 11:25 ` [PATCH BlueZ 1/2] core: Fix leftover signal for UUIDs property Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.