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



commit 4871aa66f77a446fd4ea46826dffe221fdbae2ac
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 2a375ab..1b60be6 100644
--- a/js/ui/remoteSearch.js
+++ b/js/ui/remoteSearch.js
@@ -171,10 +171,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]