[gnome-shell/wip/re-search: 452/457] remoteSearch: Only add createIcon to meta if an icon is specified



commit f4ac321ba8d57376d979aaf86761dc941364b0b4
Author: Tanner Doshier <doshitan gmail com>
Date:   Thu Aug 16 21:24:51 2012 -0500

    remoteSearch: Only add createIcon to meta if an icon is specified
    
    Instead of doing this, we could just check if the return from createIcon is
    undefined or null and just not add it to the ListSearchResult on creation.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=681797

 js/ui/remoteSearch.js |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/remoteSearch.js b/js/ui/remoteSearch.js
index 26bac48..f71291f 100644
--- a/js/ui/remoteSearch.js
+++ b/js/ui/remoteSearch.js
@@ -175,10 +175,14 @@ const RemoteSearchProvider = new Lang.Class({
         for (let i = 0; i < metas.length; i++) {
             for (let prop in metas[i])
                 metas[i][prop] = metas[i][prop].deep_unpack();
-            resultMetas.push({ id: metas[i]['id'],
-                               name: metas[i]['name'],
-                               createIcon: Lang.bind(this,
-                                                     this.createIcon, metas[i]) });
+
+            let meta = { id: metas[i]['id'],
+                         name: metas[i]['name'] };
+
+            if (metas[i]['gicon'] || metas[i]['icon-data'])
+                meta['createIcon'] = Lang.bind(this, this.createIcon, metas[i]);
+
+            resultMetas.push(meta);
         }
         callback(resultMetas);
     },



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