2014-03-27 12:52 GMT+01:00 Stefan Schmidt <[email protected]>:

> stefan pushed a commit to branch master.
>
>
> http://git.enlightenment.org/core/enlightenment.git/commit/?id=ca07e7d505274377635fda2a79d8ac8c61877ea6
>
> commit ca07e7d505274377635fda2a79d8ac8c61877ea6
> Author: Stefan Schmidt <[email protected]>
> Date:   Thu Mar 27 12:47:21 2014 +0100
>
>     bugfix: music_control: Use correct markup for metadata text.
>
>     We piped the plain metadata text to edje TEXTBLOCK which might
> interpret
>     some of the characters as markup. Better convert it to the correct
> markup
>     first. The actual bug case was a & in the metadata cut off the rest of
>     the text. Now we get the correct &amp before sending it of to edje.
>
>     Fixes T1061
> ---
>  src/modules/music-control/e_mod_main.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/src/modules/music-control/e_mod_main.c
> b/src/modules/music-control/e_mod_main.c
> index 58bf32f..b8e7244 100644
> --- a/src/modules/music-control/e_mod_main.c
> +++ b/src/modules/music-control/e_mod_main.c
> @@ -224,7 +224,7 @@ parse_metadata(E_Music_Control_Module_Context *ctxt,
> Eina_Value *array)
>
>     for (i = 0; i < eina_value_array_count(array); i++)
>       {
> -        const char *key, *str_val;
> +        const char *key, *str_val, *str_markup;
>          Eina_Value st, subst;
>          Efreet_Uri *uri;
>
> @@ -234,14 +234,16 @@ parse_metadata(E_Music_Control_Module_Context *ctxt,
> Eina_Value *array)
>            {
>               eina_value_struct_value_get(&st, "arg1", &subst);
>               eina_value_struct_get(&subst, "arg0", &str_val);
> -             ctxt->meta_title = eina_stringshare_add(str_val);
> +             str_markup = evas_textblock_text_utf8_to_markup(NULL,
> str_val);
> +             ctxt->meta_title = eina_stringshare_add(str_markup);
>               eina_value_flush(&subst);
>

I think that the string returned by evas_textblock_text_utf8_to_markup()
must
be freed after usage. Aren't you leaking 3 times in this case?



>            }
>          else if (!strcmp(key, "xesam:album"))
>            {
>               eina_value_struct_value_get(&st, "arg1", &subst);
>               eina_value_struct_get(&subst, "arg0", &str_val);
> -             ctxt->meta_album = eina_stringshare_add(str_val);
> +             str_markup = evas_textblock_text_utf8_to_markup(NULL,
> str_val);
> +             ctxt->meta_album = eina_stringshare_add(str_markup);
>               eina_value_flush(&subst);
>            }
>          else if (!strcmp(key, "xesam:artist"))
> @@ -250,7 +252,8 @@ parse_metadata(E_Music_Control_Module_Context *ctxt,
> Eina_Value *array)
>               eina_value_struct_value_get(&st, "arg1", &subst);
>               eina_value_struct_value_get(&subst, "arg0", &arr);
>               eina_value_array_get(&arr, 0, &str_val);
> -             ctxt->meta_artist = eina_stringshare_add(str_val);
> +             str_markup = evas_textblock_text_utf8_to_markup(NULL,
> str_val);
> +             ctxt->meta_artist = eina_stringshare_add(str_markup);
>               eina_value_flush(&arr);
>               eina_value_flush(&subst);
>            }
>
> --
>
>
>
------------------------------------------------------------------------------
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to