[gnome-control-center] search-provider: escape the description passed to gnome-shell



commit 6ddd56a9a27a040fd953603f7c9cc5eed5977bba
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Fri Mar 1 00:36:30 2013 +0100

    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

 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 70d8642..9376735 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);


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