iface-modem-messaging: new property to handle the list of SMS objects

This commit is contained in:
Aleksander Morgado
2012-02-01 09:54:28 +01:00
parent fba16a2a2c
commit 03ee0b44f6
2 changed files with 27 additions and 1 deletions

View File

@@ -18,6 +18,7 @@
#include "mm-iface-modem.h"
#include "mm-iface-modem-messaging.h"
#include "mm-sms-list.h"
#include "mm-log.h"
#define SUPPORT_CHECKED_TAG "messaging-support-checked-tag"
@@ -103,6 +104,11 @@ interface_disabling_step (DisablingContext *ctx)
ctx->step++;
case DISABLING_STEP_LAST:
/* Clear SMS list */
g_object_set (ctx->self,
MM_IFACE_MODEM_MESSAGING_SMS_LIST, NULL,
NULL);
/* We are done without errors! */
g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE);
disabling_context_complete_and_free (ctx);
@@ -186,7 +192,18 @@ static void
interface_enabling_step (EnablingContext *ctx)
{
switch (ctx->step) {
case ENABLING_STEP_FIRST:
case ENABLING_STEP_FIRST: {
MMSmsList *list;
list = mm_sms_list_new (MM_BASE_MODEM (ctx->self));
g_object_set (ctx->self,
MM_IFACE_MODEM_MESSAGING_SMS_LIST, list,
NULL);
g_object_unref (list);
/* Fall down to next step */
ctx->step++;
}
/* Fall down to next step */
ctx->step++;
@@ -434,6 +451,14 @@ iface_modem_messaging_init (gpointer g_iface)
MM_GDBUS_TYPE_MODEM_MESSAGING_SKELETON,
G_PARAM_READWRITE));
g_object_interface_install_property
(g_iface,
g_param_spec_object (MM_IFACE_MODEM_MESSAGING_SMS_LIST,
"SMS list",
"List of SMS objects managed in the interface",
MM_TYPE_SMS_LIST,
G_PARAM_READWRITE));
initialized = TRUE;
}

View File

@@ -27,6 +27,7 @@
#define MM_IFACE_MODEM_MESSAGING_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MM_TYPE_IFACE_MODEM_MESSAGING, MMIfaceModemMessaging))
#define MM_IFACE_MODEM_MESSAGING_DBUS_SKELETON "iface-modem-messaging-dbus-skeleton"
#define MM_IFACE_MODEM_MESSAGING_SMS_LIST "iface-modem-messaging-sms-list"
typedef struct _MMIfaceModemMessaging MMIfaceModemMessaging;