All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 1/2] gdbus: Add g_dbus_flush_properties()
@ 2013-04-18 17:50 Vinicius Costa Gomes
  2013-04-18 17:50 ` [RFC 2/2] device: Fix the wrong order of UUIDs PropertyChanged Vinicius Costa Gomes
  2013-04-19  6:30 ` [RFC 1/2] gdbus: Add g_dbus_flush_properties() Luiz Augusto von Dentz
  0 siblings, 2 replies; 16+ messages in thread
From: Vinicius Costa Gomes @ 2013-04-18 17:50 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Vinicius Costa Gomes

In some situations, it may be useful to be sure that all the
properties updates for a object are sent.
---
 gdbus/gdbus.h  |  2 ++
 gdbus/object.c | 19 +++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h
index 8b13393..ed280e4 100644
--- a/gdbus/gdbus.h
+++ b/gdbus/gdbus.h
@@ -299,6 +299,8 @@ void g_dbus_emit_property_changed(DBusConnection *connection,
 gboolean g_dbus_get_properties(DBusConnection *connection, const char *path,
 				const char *interface, DBusMessageIter *iter);
 
+gboolean g_dbus_flush_properties(DBusConnection *connection, const char *path);
+
 gboolean g_dbus_attach_object_manager(DBusConnection *connection);
 gboolean g_dbus_detach_object_manager(DBusConnection *connection);
 
diff --git a/gdbus/object.c b/gdbus/object.c
index 2f8ef45..14b6803 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -1751,6 +1751,25 @@ gboolean g_dbus_get_properties(DBusConnection *connection, const char *path,
 	return TRUE;
 }
 
+gboolean g_dbus_flush_properties(DBusConnection *connection, const char *path)
+{
+	struct generic_data *data;
+
+	if (path == NULL)
+		return FALSE;
+
+	if (!dbus_connection_get_object_path_data(connection, path,
+					(void **) &data) || data == NULL)
+		return FALSE;
+
+	if (data->process_id)
+		g_source_remove(data->process_id);
+
+	process_changes(data);
+
+	return TRUE;
+}
+
 gboolean g_dbus_attach_object_manager(DBusConnection *connection)
 {
 	struct generic_data *data;
-- 
1.8.2.1


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

end of thread, other threads:[~2013-06-26 22:09 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-18 17:50 [RFC 1/2] gdbus: Add g_dbus_flush_properties() Vinicius Costa Gomes
2013-04-18 17:50 ` [RFC 2/2] device: Fix the wrong order of UUIDs PropertyChanged Vinicius Costa Gomes
2013-04-19  6:30 ` [RFC 1/2] gdbus: Add g_dbus_flush_properties() Luiz Augusto von Dentz
2013-04-19 13:34   ` Vinicius Costa Gomes
2013-04-24 13:58     ` Johan Hedberg
2013-04-24 14:24       ` Vinicius Costa Gomes
2013-04-24 17:33       ` Lucas De Marchi
2013-04-24 17:56         ` Vinicius Costa Gomes
2013-04-24 18:09           ` Lucas De Marchi
2013-04-24 18:19             ` Vinicius Costa Gomes
2013-04-24 18:36         ` Johan Hedberg
2013-04-24 19:01           ` Lucas De Marchi
2013-04-24 20:14             ` Amro Mouslli
2013-06-26 19:11             ` João Paulo Rechi Vita
2013-06-26 19:49               ` Johan Hedberg
2013-06-26 22:09                 ` Lucas De Marchi

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.