From 2481d97d525b5e6a9d91d893892c72fcc91f7217 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Mon, 10 Sep 2012 13:58:54 +0200 Subject: iface-modem-messaging: load initial SMS parts after having set default storages We really want the 'mem3' storage set as soon as possible. --- src/mm-iface-modem-messaging.c | 56 +++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/mm-iface-modem-messaging.c b/src/mm-iface-modem-messaging.c index 77665c28..2a8415e6 100644 --- a/src/mm-iface-modem-messaging.c +++ b/src/mm-iface-modem-messaging.c @@ -675,8 +675,8 @@ static void interface_enabling_step (EnablingContext *ctx); typedef enum { ENABLING_STEP_FIRST, ENABLING_STEP_SETUP_SMS_FORMAT, - ENABLING_STEP_LOAD_INITIAL_SMS_PARTS, ENABLING_STEP_STORAGE_DEFAULTS, + ENABLING_STEP_LOAD_INITIAL_SMS_PARTS, ENABLING_STEP_SETUP_UNSOLICITED_EVENTS, ENABLING_STEP_ENABLE_UNSOLICITED_EVENTS, ENABLING_STEP_LAST @@ -793,6 +793,23 @@ load_initial_sms_parts_ready (MMIfaceModemMessaging *self, load_initial_sms_parts_from_storages (ctx); } +static void +set_default_storages_ready (MMIfaceModemMessaging *self, + GAsyncResult *res, + EnablingContext *ctx) +{ + GError *error = NULL; + + if (!mm_iface_modem_messaging_set_preferred_storages_finish (self, res, &error)) { + mm_dbg ("Couldn't set preferred storages: '%s'", error->message); + g_error_free (error); + } + + /* Go on with next step */ + ctx->step++; + interface_enabling_step (ctx); +} + static void load_initial_sms_parts_from_storages (EnablingContext *ctx) { @@ -829,23 +846,6 @@ load_initial_sms_parts_from_storages (EnablingContext *ctx) return; } -static void -set_default_storages_ready (MMIfaceModemMessaging *self, - GAsyncResult *res, - EnablingContext *ctx) -{ - GError *error = NULL; - - if (!mm_iface_modem_messaging_set_preferred_storages_finish (self, res, &error)) { - mm_dbg ("Couldn't set preferred storages: '%s'", error->message); - g_error_free (error); - } - - /* Go on with next step */ - ctx->step++; - interface_enabling_step (ctx); -} - VOID_REPLY_READY_FN (setup_unsolicited_events) static void @@ -911,16 +911,6 @@ interface_enabling_step (EnablingContext *ctx) /* Fall down to next step */ ctx->step++; - case ENABLING_STEP_LOAD_INITIAL_SMS_PARTS: - /* Allow loading the initial list of SMS parts */ - if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->load_initial_sms_parts && - MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->load_initial_sms_parts_finish) { - load_initial_sms_parts_from_storages (ctx); - return; - } - /* Fall down to next step */ - ctx->step++; - case ENABLING_STEP_STORAGE_DEFAULTS: /* Set storage defaults */ mm_dbg ("Setting default preferred storages..."); @@ -932,6 +922,16 @@ interface_enabling_step (EnablingContext *ctx) ctx); return; + case ENABLING_STEP_LOAD_INITIAL_SMS_PARTS: + /* Allow loading the initial list of SMS parts */ + if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->load_initial_sms_parts && + MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->load_initial_sms_parts_finish) { + load_initial_sms_parts_from_storages (ctx); + return; + } + /* Fall down to next step */ + ctx->step++; + case ENABLING_STEP_SETUP_UNSOLICITED_EVENTS: /* Allow setting up unsolicited events */ if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->setup_unsolicited_events && -- cgit v1.2.3-70-g09d2