linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/7] gdbus: Add g_dbus_client_get_proxy
@ 2013-01-11 11:50 Luiz Augusto von Dentz
  2013-01-11 11:50 ` [PATCH BlueZ 2/7] gdbus: Add g_dbus_proxy_get_client function Luiz Augusto von Dentz
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Luiz Augusto von Dentz @ 2013-01-11 11:50 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

g_dbus_client_get_proxy gives the possibilitity to just check if a
proxy exist for the given path and interface pair instead of using
g_dbus_proxy_new which end up creating a proxy if it doesn't exists
which is not always necessary.
---
 gdbus/client.c | 8 ++++----
 gdbus/gdbus.h  | 3 +++
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/gdbus/client.c b/gdbus/client.c
index c03e3a4..ea56023 100644
--- a/gdbus/client.c
+++ b/gdbus/client.c
@@ -328,8 +328,8 @@ static void get_all_properties(GDBusProxy *proxy)
 	dbus_message_unref(msg);
 }
 
-static GDBusProxy *proxy_lookup(GDBusClient *client, const char *path,
-						const char *interface)
+GDBusProxy *g_dbus_client_get_proxy(GDBusClient *client, const char *path,
+							const char *interface)
 {
 	GList *list;
 
@@ -423,7 +423,7 @@ GDBusProxy *g_dbus_proxy_new(GDBusClient *client, const char *path,
 	if (client == NULL)
 		return NULL;
 
-	proxy = proxy_lookup(client, path, interface);
+	proxy = g_dbus_client_get_proxy(client, path, interface);
 	if (proxy)
 		return g_dbus_proxy_ref(proxy);
 
@@ -841,7 +841,7 @@ static void parse_properties(GDBusClient *client, const char *path,
 	if (g_str_equal(interface, DBUS_INTERFACE_PROPERTIES) == TRUE)
 		return;
 
-	proxy = proxy_lookup(client, path, interface);
+	proxy = g_dbus_client_get_proxy(client, path, interface);
 	if (proxy) {
 		update_properties(proxy, iter);
 		return;
diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h
index 6f5a012..77bd069 100644
--- a/gdbus/gdbus.h
+++ b/gdbus/gdbus.h
@@ -360,6 +360,9 @@ gboolean g_dbus_client_set_proxy_handlers(GDBusClient *client,
 					GDBusPropertyFunction property_changed,
 					void *user_data);
 
+GDBusProxy *g_dbus_client_get_proxy(GDBusClient *client, const char *path,
+							const char *interface);
+
 #ifdef __cplusplus
 }
 #endif
-- 
1.8.0.1


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

end of thread, other threads:[~2013-01-13 23:03 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-11 11:50 [PATCH BlueZ 1/7] gdbus: Add g_dbus_client_get_proxy Luiz Augusto von Dentz
2013-01-11 11:50 ` [PATCH BlueZ 2/7] gdbus: Add g_dbus_proxy_get_client function Luiz Augusto von Dentz
2013-01-11 20:47   ` Marcel Holtmann
2013-01-13 16:24     ` Luiz Augusto von Dentz
2013-01-13 21:12       ` Marcel Holtmann
2013-01-11 11:50 ` [PATCH BlueZ 3/7] unit: Add gdbus/client_get_dict_property Luiz Augusto von Dentz
2013-01-11 11:50 ` [PATCH BlueZ 4/7] unit: Add gdbus/client_get_string_property Luiz Augusto von Dentz
2013-01-11 11:50 ` [PATCH BlueZ 5/7] unit: Add gdbus/client_get_boolean_property Luiz Augusto von Dentz
2013-01-11 11:50 ` [PATCH BlueZ 6/7] unit: Add gdbus/client_get_array_property Luiz Augusto von Dentz
2013-01-11 11:50 ` [PATCH BlueZ 7/7] unit: Add gdbus/client_get_uint64_property Luiz Augusto von Dentz
2013-01-11 20:46 ` [PATCH BlueZ 1/7] gdbus: Add g_dbus_client_get_proxy Marcel Holtmann
2013-01-13 16:09   ` Luiz Augusto von Dentz
2013-01-13 21:09     ` Marcel Holtmann
2013-01-13 22:36       ` Luiz Augusto von Dentz
2013-01-13 23:03         ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).