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
This commit is contained in:
Stefan Schmidt 2014-03-27 12:47:21 +01:00
parent 5e4abbef90
commit ca07e7d505
1 changed files with 7 additions and 4 deletions

View File

@ -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);
}
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);
}