sms: use property accessors from parent MmGdbusSms when it simplifies things
This commit is contained in:
32
src/mm-sms.c
32
src/mm-sms.c
@@ -104,9 +104,7 @@ handle_store_ready (MMSms *self,
|
|||||||
g_object_get (self->priv->modem,
|
g_object_get (self->priv->modem,
|
||||||
MM_IFACE_MODEM_MESSAGING_SMS_MEM2_STORAGE, &storage,
|
MM_IFACE_MODEM_MESSAGING_SMS_MEM2_STORAGE, &storage,
|
||||||
NULL);
|
NULL);
|
||||||
g_object_set (self,
|
mm_gdbus_sms_set_storage (MM_GDBUS_SMS (ctx->self), storage);
|
||||||
"storage", storage,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
/* Transition from Unknown->Stored for SMS which were created by the user */
|
/* Transition from Unknown->Stored for SMS which were created by the user */
|
||||||
if (mm_gdbus_sms_get_state (MM_GDBUS_SMS (ctx->self)) == MM_SMS_STATE_UNKNOWN)
|
if (mm_gdbus_sms_get_state (MM_GDBUS_SMS (ctx->self)) == MM_SMS_STATE_UNKNOWN)
|
||||||
@@ -354,12 +352,7 @@ mm_sms_get_path (MMSms *self)
|
|||||||
MMSmsStorage
|
MMSmsStorage
|
||||||
mm_sms_get_storage (MMSms *self)
|
mm_sms_get_storage (MMSms *self)
|
||||||
{
|
{
|
||||||
MMSmsStorage storage = MM_SMS_STORAGE_UNKNOWN;
|
return mm_gdbus_sms_get_storage (MM_GDBUS_SMS (self));
|
||||||
|
|
||||||
g_object_get (self,
|
|
||||||
"storage", &storage,
|
|
||||||
NULL);
|
|
||||||
return storage;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
@@ -867,10 +860,7 @@ delete_next_part (SmsDeletePartsContext *ctx)
|
|||||||
else {
|
else {
|
||||||
/* We do change the state of this SMS back to UNKNOWN, as it is no
|
/* We do change the state of this SMS back to UNKNOWN, as it is no
|
||||||
* longer stored in the device */
|
* longer stored in the device */
|
||||||
g_object_set (ctx->self,
|
mm_gdbus_sms_set_state (MM_GDBUS_SMS (ctx->self), MM_SMS_STATE_UNKNOWN);
|
||||||
"state", MM_SMS_STATE_UNKNOWN,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE);
|
g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE);
|
||||||
}
|
}
|
||||||
sms_delete_parts_context_complete_and_free (ctx);
|
sms_delete_parts_context_complete_and_free (ctx);
|
||||||
@@ -1106,18 +1096,10 @@ mm_sms_multipart_take_part (MMSms *self,
|
|||||||
inner_error->message);
|
inner_error->message);
|
||||||
g_error_free (inner_error);
|
g_error_free (inner_error);
|
||||||
} else {
|
} else {
|
||||||
/* Completed AND assembled */
|
/* Completed AND assembled
|
||||||
MMSmsState state = MM_SMS_STATE_UNKNOWN;
|
* Change state RECEIVING->RECEIVED, and signal completeness */
|
||||||
|
if (mm_gdbus_sms_get_state (MM_GDBUS_SMS (self)) == MM_SMS_STATE_RECEIVING)
|
||||||
/* Change state RECEIVING->RECEIVED, and signal completeness */
|
mm_gdbus_sms_set_state (MM_GDBUS_SMS (self), MM_SMS_STATE_RECEIVED);
|
||||||
g_object_get (self,
|
|
||||||
"state", &state,
|
|
||||||
NULL);
|
|
||||||
if (state == MM_SMS_STATE_RECEIVING) {
|
|
||||||
g_object_set (self,
|
|
||||||
"state", MM_SMS_STATE_RECEIVED,
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user