diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-08 15:30:48 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-16 14:53:23 +0100 |
commit | 215c27808230352e3def81b45808ef29a9cd5b7a (patch) | |
tree | eb13847893fba8bf95311563c3757fdbbac1a0c2 /src/mm-iface-modem.c | |
parent | 7bfc56c2a8d1d5d9eb70cdfa803b840c176071b2 (diff) |
base-modem: new modem-wide cancellable, passed to every state machine
Diffstat (limited to 'src/mm-iface-modem.c')
-rw-r--r-- | src/mm-iface-modem.c | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c index 0e3b0017..2a294bed 100644 --- a/src/mm-iface-modem.c +++ b/src/mm-iface-modem.c @@ -1164,12 +1164,12 @@ enable_ready (MMBaseModem *self, GError *error = NULL; if (ctx->enable) { - if (!MM_BASE_MODEM_GET_CLASS (self)->enable_finish (self, res, &error)) + if (!mm_base_modem_enable_finish (self, res, &error)) g_dbus_method_invocation_take_error (ctx->invocation, error); else mm_gdbus_modem_complete_enable (ctx->skeleton, ctx->invocation); } else { - if (!MM_BASE_MODEM_GET_CLASS (self)->disable_finish (self, res, &error)) + if (!mm_base_modem_disable_finish (self, res, &error)) g_dbus_method_invocation_take_error (ctx->invocation, error); else mm_gdbus_modem_complete_enable (ctx->skeleton, ctx->invocation); @@ -1191,25 +1191,14 @@ handle_enable_auth_ready (MMBaseModem *self, return; } - if (ctx->enable) { - g_assert (MM_BASE_MODEM_GET_CLASS (self)->enable != NULL); - g_assert (MM_BASE_MODEM_GET_CLASS (self)->enable_finish != NULL); - - MM_BASE_MODEM_GET_CLASS (self)->enable ( - self, - NULL, /* cancellable */ - (GAsyncReadyCallback)enable_ready, - ctx); - } else { - g_assert (MM_BASE_MODEM_GET_CLASS (self)->disable != NULL); - g_assert (MM_BASE_MODEM_GET_CLASS (self)->disable_finish != NULL); - - MM_BASE_MODEM_GET_CLASS (self)->disable ( - self, - NULL, /* cancellable */ - (GAsyncReadyCallback)enable_ready, - ctx); - } + if (ctx->enable) + mm_base_modem_enable (self, + (GAsyncReadyCallback)enable_ready, + ctx); + else + mm_base_modem_disable (self, + (GAsyncReadyCallback)enable_ready, + ctx); } static gboolean @@ -2010,11 +1999,7 @@ unlock_check_context_free (UnlockCheckContext *ctx) static gboolean restart_initialize_idle (MMIfaceModem *self) { - MM_BASE_MODEM_GET_CLASS (self)->initialize ( - MM_BASE_MODEM (self), - NULL, - NULL, - NULL); + mm_base_modem_initialize (MM_BASE_MODEM (self), NULL, NULL); return FALSE; } |