aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-01-21 18:24:06 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:14:55 +0100
commit77999f3bcec7753bdcc5a51da4c271c78157f051 (patch)
treecda2bd2261f90ddf86b9c027bf7e5e3d96a94af0
parent718093dc59f2cce7556d28efa4a26866b39e4c2e (diff)
bearer-list: new method to look for a bearer using its properties
-rw-r--r--src/mm-bearer-list.c14
-rw-r--r--src/mm-bearer-list.h3
2 files changed, 17 insertions, 0 deletions
diff --git a/src/mm-bearer-list.c b/src/mm-bearer-list.c
index 37069acc..a7f6abf0 100644
--- a/src/mm-bearer-list.c
+++ b/src/mm-bearer-list.c
@@ -165,6 +165,20 @@ mm_bearer_list_foreach (MMBearerList *self,
g_list_foreach (self->priv->bearers, (GFunc)func, user_data);
}
+MMBearer *
+mm_bearer_list_find (MMBearerList *self,
+ MMCommonBearerProperties *properties)
+{
+ GList *l;
+
+ for (l = self->priv->bearers; l; l = g_list_next (l)) {
+ if (mm_bearer_cmp_properties (MM_BEARER (l->data), properties))
+ return g_object_ref (l->data);
+ }
+
+ return NULL;
+}
+
/*****************************************************************************/
typedef struct {
diff --git a/src/mm-bearer-list.h b/src/mm-bearer-list.h
index e1294ca1..6f2cf591 100644
--- a/src/mm-bearer-list.h
+++ b/src/mm-bearer-list.h
@@ -72,6 +72,9 @@ void mm_bearer_list_foreach (MMBearerList *self,
MMBearerListForeachFunc func,
gpointer user_data);
+MMBearer *mm_bearer_list_find (MMBearerList *self,
+ MMCommonBearerProperties *properties);
+
void mm_bearer_list_disconnect_all_bearers (MMBearerList *self,
GAsyncReadyCallback callback,
gpointer user_data);