linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 1/7] gdbus: Add g_dbus_client_get_proxy
Date: Fri, 11 Jan 2013 13:50:12 +0200	[thread overview]
Message-ID: <1357905018-23237-1-git-send-email-luiz.dentz@gmail.com> (raw)

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


             reply	other threads:[~2013-01-11 11:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-11 11:50 Luiz Augusto von Dentz [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1357905018-23237-1-git-send-email-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).