From 295bd4a9d96be39cad5bb85e50b3b682c89d65aa Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 6 Jun 2008 17:55:02 +0000 Subject: Remove use of dbus_connection_get_object_user_data from network. --- network/connection.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/network/connection.c b/network/connection.c index c57623b0..55c9c529 100644 --- a/network/connection.c +++ b/network/connection.c @@ -648,11 +648,14 @@ int connection_find_data(const char *path, const char *pattern) gboolean connection_has_pending(const char *path) { struct network_conn *nc; + GSList *l; - if (!dbus_connection_get_object_user_data(connection, - path, (void *) &nc)) + l = g_slist_find_custom(connections, path, find_connection); + if (!l) return FALSE; + nc = l->data; + return (nc->state == CONNECTING); } @@ -664,11 +667,14 @@ int connection_remove_stored(const char *path) char filename[PATH_MAX + 1]; char src_addr[18], dst_addr[18]; int err; + GSList *l; - if (!dbus_connection_get_object_user_data(connection, - path, (void *) &nc)) + l = g_slist_find_custom(connections, path, find_connection); + if (!l) return -ENOENT; + nc = l->data; + ba2str(&nc->dst, dst_addr); role = bnep_name(nc->id); snprintf(key, 32, "%s#%s", dst_addr, role); @@ -684,11 +690,14 @@ int connection_remove_stored(const char *path) gboolean connection_is_connected(const char *path) { struct network_conn *nc; + GSList *l; - if (!dbus_connection_get_object_user_data(connection, - path, (void *) &nc)) + l = g_slist_find_custom(connections, path, find_connection); + if (!l) return FALSE; + nc = l->data; + return (nc->state == CONNECTED); } -- cgit