Open Source Telephony
 help / color / mirror / Atom feed
* [PATCH v0 1/2] hfp_hf_bluez5: Improve Proxy property changed handling
@ 2013-01-30 16:24 Claudio Takahasi
  2013-01-30 16:24 ` [PATCH v0 2/2] hfp_hf_bluez5: Only register modems for Paired devices Claudio Takahasi
  2013-01-31  3:33 ` [PATCH v0 1/2] hfp_hf_bluez5: Improve Proxy property changed handling Denis Kenzior
  0 siblings, 2 replies; 5+ messages in thread
From: Claudio Takahasi @ 2013-01-30 16:24 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1203 bytes --]

This patch removes unnecessary GDBusProxy object access when property
changed is triggered. The property name and the argument iterator is
informed in the function callback.
---
 plugins/hfp_hf_bluez5.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/plugins/hfp_hf_bluez5.c b/plugins/hfp_hf_bluez5.c
index 2aabdd2..653829b 100644
--- a/plugins/hfp_hf_bluez5.c
+++ b/plugins/hfp_hf_bluez5.c
@@ -540,7 +540,6 @@ static void property_changed(GDBusProxy *proxy, const char *name,
 {
 	const char *interface, *path, *alias;
 	struct ofono_modem *modem;
-	DBusMessageIter alias_iter;
 
 	interface = g_dbus_proxy_get_interface(proxy);
 	path = g_dbus_proxy_get_path(proxy);
@@ -550,10 +549,10 @@ static void property_changed(GDBusProxy *proxy, const char *name,
 	if (g_str_equal(BLUEZ_DEVICE_INTERFACE, interface) == FALSE)
 		return;
 
-	if (g_dbus_proxy_get_property(proxy, "Alias", &alias_iter) == FALSE)
+	if (g_str_equal("Alias", name) == FALSE)
 		return;
 
-	dbus_message_iter_get_basic(&alias_iter, &alias);
+	dbus_message_iter_get_basic(iter, &alias);
 
 	modem = g_hash_table_lookup(modem_hash, path);
 	if (modem == NULL)
-- 
1.7.11.7


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

end of thread, other threads:[~2013-01-31 12:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-30 16:24 [PATCH v0 1/2] hfp_hf_bluez5: Improve Proxy property changed handling Claudio Takahasi
2013-01-30 16:24 ` [PATCH v0 2/2] hfp_hf_bluez5: Only register modems for Paired devices Claudio Takahasi
2013-01-31  3:44   ` Denis Kenzior
2013-01-31 12:12     ` Claudio Takahasi
2013-01-31  3:33 ` [PATCH v0 1/2] hfp_hf_bluez5: Improve Proxy property changed handling Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox