Re: [MM] [PATCH] sms: use g_variant_new_from_data instead of g_variant_new_fixed_array



On 09/06/2012 08:26 AM, Ben Chan wrote:
> ModemManager configure script currenty requires glib 2.30.2 or later,
> bud g_variant_new_fixed_array requires at least glib 2.32. To maintain
> the compatibility with glib 2.30, this patch modifies the code to use
> g_variant_new_from_data instead of g_variant_new_fixed_array.

Was thinking in putting the new code between GLIB_CHECK_VERSION(2,32,0),
but the change is so simple that it's probably not worth it.

Pushed like this, thanks.


> ---
>  src/mm-sms.c |   10 ++++++----
>  1 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/src/mm-sms.c b/src/mm-sms.c
> index f4ba566..12e6dbc 100644
> --- a/src/mm-sms.c
> +++ b/src/mm-sms.c
> @@ -1001,10 +1001,12 @@ assemble_sms (MMSms *self,
>      /* If we got everything, assemble the text! */
>      g_object_set (self,
>                    "text",      fulltext,
> -                  "data",      g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
> -                                                          fulldata->data,
> -                                                          fulldata->len,
> -                                                          sizeof (guchar)),
> +                  "data",      g_variant_new_from_data (G_VARIANT_TYPE ("ay"),
> +                                                        fulldata->data,
> +                                                        fulldata->len * sizeof (guint8),
> +                                                        TRUE,
> +                                                        NULL,
> +                                                        NULL),
>                    "smsc",      mm_sms_part_get_smsc (sorted_parts[0]),
>                    "class",     mm_sms_part_get_class (sorted_parts[0]),
>                    "number",    mm_sms_part_get_number (sorted_parts[0]),
> 


-- 
Aleksander


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]