aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem-messaging.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-02-10 17:06:23 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:15:03 +0100
commit50d474056dcc9836f4fbd43d3370d0097bacd378 (patch)
tree52d1a2331da661184c9598a0604b2f4f2d8a929f /src/mm-iface-modem-messaging.c
parent8c8e5efa14b9eaee8e24cd8122ec885f0cf1eabd (diff)
iface-modem-messaging: once all messages initially loaded, set default storages
Diffstat (limited to 'src/mm-iface-modem-messaging.c')
-rw-r--r--src/mm-iface-modem-messaging.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/mm-iface-modem-messaging.c b/src/mm-iface-modem-messaging.c
index cf9c36a6..879e5fef 100644
--- a/src/mm-iface-modem-messaging.c
+++ b/src/mm-iface-modem-messaging.c
@@ -355,7 +355,7 @@ mm_iface_modem_messaging_set_preferred_storages (MMIfaceModemMessaging *self,
callback,
user_data,
MM_CORE_ERROR,
- MM_CORE_ERROR_FAILED,
+ MM_CORE_ERROR_UNSUPPORTED,
"Setting preferred storage is not supported");
return;
}
@@ -552,6 +552,7 @@ typedef enum {
ENABLING_STEP_SETUP_SMS_FORMAT,
ENABLING_STEP_SETUP_UNSOLICITED_EVENTS,
ENABLING_STEP_LOAD_INITIAL_SMS_PARTS,
+ ENABLING_STEP_STORAGE_DEFAULTS,
ENABLING_STEP_LAST
} EnablingStep;
@@ -689,6 +690,23 @@ load_initial_sms_parts_from_storages (EnablingContext *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
interface_enabling_step (EnablingContext *ctx)
{
switch (ctx->step) {
@@ -752,6 +770,17 @@ interface_enabling_step (EnablingContext *ctx)
/* Fall down to next step */
ctx->step++;
+ case ENABLING_STEP_STORAGE_DEFAULTS:
+ /* Set storage defaults */
+ mm_dbg ("Setting default preferred storages...");
+ mm_iface_modem_messaging_set_preferred_storages (ctx->self,
+ MM_SMS_STORAGE_UNKNOWN,
+ MM_SMS_STORAGE_UNKNOWN,
+ MM_SMS_STORAGE_UNKNOWN,
+ (GAsyncReadyCallback)set_default_storages_ready,
+ ctx);
+ return;
+
case ENABLING_STEP_LAST:
/* We are done without errors! */
g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE);