bearer-list: new method to look for a bearer using its properties

This commit is contained in:
Aleksander Morgado
2012-03-15 14:14:55 +01:00
parent 718093dc59
commit 77999f3bce
2 changed files with 17 additions and 0 deletions
+14
View File
@@ -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 {
+3
View File
@@ -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);