[gnome-shell/wip/re-search: 9/12] remoteSearch: Only add createIcon to meta if an icon is specified
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/re-search: 9/12] remoteSearch: Only add createIcon to meta if an icon is specified
- Date: Mon, 20 Aug 2012 23:49:41 +0000 (UTC)
commit d0d67a34b76d935f9ebe0adfb5401050c43c8e13
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 8c92915..59e4450 100644
--- a/js/ui/remoteSearch.js
+++ b/js/ui/remoteSearch.js
@@ -169,10 +169,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]