[gnome-shell] search: fix description of results



commit e7886734c4606ef63256106fb41372fadf9fd526
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Wed Feb 27 17:54:09 2013 +0100

    search: fix description of results
    
    "description" is documented as a valid field for search result metas,
    and ListSearchResults implements it, so pass it down to be used.
    Also, don't wrap the description in quotes, so that the search provider
    can decide if it is an excerpt from the searched text or something else.
    And to that extent, set use_markup to true, so that terms can be
    highlighted.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694906

 js/ui/remoteSearch.js  |    1 +
 js/ui/searchDisplay.js |    5 ++---
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/remoteSearch.js b/js/ui/remoteSearch.js
index 64af9e9..cd6afdf 100644
--- a/js/ui/remoteSearch.js
+++ b/js/ui/remoteSearch.js
@@ -255,6 +255,7 @@ const RemoteSearchProvider = new Lang.Class({
                 metas[i][prop] = metas[i][prop].deep_unpack();
             resultMetas.push({ id: metas[i]['id'],
                                name: metas[i]['name'],
+                               description: metas[i]['description'],
                                createIcon: Lang.bind(this,
                                                      this.createIcon, metas[i]) });
         }
diff --git a/js/ui/searchDisplay.js b/js/ui/searchDisplay.js
index c54cd00..bdc45e4 100644
--- a/js/ui/searchDisplay.js
+++ b/js/ui/searchDisplay.js
@@ -103,10 +103,9 @@ const ListSearchResult = new Lang.Class({
                              x_align: St.Align.START,
                              y_align: St.Align.START });
 
-        // TODO: should highlight terms in the description here
         if (this.metaInfo['description']) {
-            let description = new St.Label({ style_class: 'list-search-result-description',
-                                             text: '"' + this.metaInfo['description'] + '"' });
+            let description = new St.Label({ style_class: 'list-search-result-description' });
+            description.clutter_text.set_markup(this.metaInfo['description']);
             details.add(description, { x_fill: false,
                                        y_fill: false,
                                        x_align: St.Align.START,


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