diff options
author | Giovanni Campagna <gcampagna@src.gnome.org> | 2013-03-01 00:36:30 +0100 |
---|---|---|
committer | Giovanni Campagna <gcampagna@src.gnome.org> | 2013-03-01 17:59:07 +0100 |
commit | 6ddd56a9a27a040fd953603f7c9cc5eed5977bba (patch) | |
tree | f16b285300b0379359054362b05c810b30c655f7 /search-provider/cc-search-provider.c | |
parent | fb7d156d6945870efaf6ead6db0e2ab2ecb4e2ae (diff) | |
download | gnome-control-center-6ddd56a9a27a040fd953603f7c9cc5eed5977bba.tar.gz |
search-provider: escape the description passed to gnome-shell
gnome-shell uses the description as markup (to allow highlighting
the searched terms), so we need to properly escape it to avoid warnings.
https://bugzilla.gnome.org/show_bug.cgi?id=694908
Diffstat (limited to 'search-provider/cc-search-provider.c')
-rw-r--r-- | search-provider/cc-search-provider.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/search-provider/cc-search-provider.c b/search-provider/cc-search-provider.c index 70d8642d1..93767357a 100644 --- a/search-provider/cc-search-provider.c +++ b/search-provider/cc-search-provider.c @@ -188,7 +188,7 @@ handle_get_result_metas (CcShellSearchProvider2 *skeleton, GVariantBuilder builder; GAppInfo *app; const char *id; - char *name, *description, *icon_string; + char *name, *description, *escaped_description, *icon_string; GIcon *icon; g_variant_builder_init (&builder, G_VARIANT_TYPE ("aa{sv}")); @@ -206,6 +206,7 @@ handle_get_result_metas (CcShellSearchProvider2 *skeleton, -1); id = g_app_info_get_id (app); icon_string = g_icon_to_string (icon); + escaped_description = g_markup_escape_text (description, -1); g_variant_builder_open (&builder, G_VARIANT_TYPE ("a{sv}")); g_variant_builder_add (&builder, "{sv}", @@ -215,11 +216,12 @@ handle_get_result_metas (CcShellSearchProvider2 *skeleton, g_variant_builder_add (&builder, "{sv}", "gicon", g_variant_new_string (icon_string)); g_variant_builder_add (&builder, "{sv}", - "description", g_variant_new_string (description)); + "description", g_variant_new_string (escaped_description)); g_variant_builder_close (&builder); g_free (name); g_free (description); + g_free (escaped_description); g_free (icon_string); g_object_unref (app); g_object_unref (icon); |