From 4c036eb8f96cae06da1f968fb9eb48f6faa12796 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 3 Dec 2015 12:01:00 +0100 Subject: iface-modem: explicitly disconnect bearer before removing it https://bugs.freedesktop.org/show_bug.cgi?id=90408 --- src/mm-bearer-list.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'src/mm-bearer-list.c') diff --git a/src/mm-bearer-list.c b/src/mm-bearer-list.c index b90448f6..205193ae 100644 --- a/src/mm-bearer-list.c +++ b/src/mm-bearer-list.c @@ -105,15 +105,6 @@ mm_bearer_list_delete_bearer (MMBearerList *self, { GList *l; - if (!g_str_has_prefix (path, MM_DBUS_BEARER_PREFIX)) { - g_set_error (error, - MM_CORE_ERROR, - MM_CORE_ERROR_INVALID_ARGS, - "Cannot delete bearer: invalid path '%s'", - path); - return FALSE; - } - for (l = self->priv->bearers; l; l = g_list_next (l)) { if (g_str_equal (path, mm_base_bearer_get_path (MM_BASE_BEARER (l->data)))) { g_object_unref (l->data); @@ -169,6 +160,20 @@ mm_bearer_list_find_by_properties (MMBearerList *self, return NULL; } +MMBaseBearer * +mm_bearer_list_find_by_path (MMBearerList *self, + const gchar *path) +{ + GList *l; + + for (l = self->priv->bearers; l; l = g_list_next (l)) { + if (g_str_equal (path, mm_base_bearer_get_path (MM_BASE_BEARER (l->data)))) + return g_object_ref (l->data); + } + + return NULL; +} + /*****************************************************************************/ typedef struct { -- cgit v1.2.3-70-g09d2