summaryrefslogtreecommitdiffstats
path: root/network
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-06-06 17:55:02 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-06-06 17:55:02 +0000
commit295bd4a9d96be39cad5bb85e50b3b682c89d65aa (patch)
tree8e1194e356ca482897b0f736bdac41d16fc6fea8 /network
parent31cde264b5d27d37b281ce1f3d6503de116ffc9d (diff)
Remove use of dbus_connection_get_object_user_data from network.
Diffstat (limited to 'network')
-rw-r--r--network/connection.c21
1 files 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);
}