[gnome-shell/wip/re-search: 14/17] placeDisplay: Remove createIcon from meta of PlaceSearchProvider



commit 798aef17f6ab0e156ff8e6dc33bc149067610fb6
Author: Tanner Doshier <doshitan gmail com>
Date:   Thu Aug 16 21:29:42 2012 -0500

    placeDisplay: Remove createIcon from meta of PlaceSearchProvider
    
    https://bugzilla.gnome.org/show_bug.cgi?id=681797

 js/ui/placeDisplay.js |   35 ++---------------------------------
 1 files changed, 2 insertions(+), 33 deletions(-)
---
diff --git a/js/ui/placeDisplay.js b/js/ui/placeDisplay.js
index 5aae072..a5c1f8e 100644
--- a/js/ui/placeDisplay.js
+++ b/js/ui/placeDisplay.js
@@ -19,17 +19,15 @@ const Util = imports.misc.util;
  * a mount/volume, or a special place like the Home Folder, Computer, and Network.
  *
  * @name: String title
- * @iconFactory: A JavaScript callback which will create an icon texture given a size parameter
  * @launch: A JavaScript callback to launch the entry
  */
 const PlaceInfo = new Lang.Class({
     Name: 'PlaceInfo',
 
-    _init: function(id, name, iconFactory, launch) {
+    _init: function(id, name, launch) {
         this.id = id;
         this.name = name;
         this._lowerName = name.toLowerCase();
-        this.iconFactory = iconFactory;
         this.launch = launch;
     },
 
@@ -81,11 +79,6 @@ const PlaceDeviceInfo = new Lang.Class({
         this.id = 'mount:' + mount.get_root().get_uri();
     },
 
-    iconFactory: function(size) {
-        let icon = this._mount.get_icon();
-        return St.TextureCache.get_default().load_gicon(null, icon, size);
-    },
-
     launch: function(params) {
         Gio.app_info_launch_default_for_uri(this._mount.get_root().get_uri(),
                                             _makeLaunchContext(params));
@@ -131,11 +124,7 @@ const PlacesManager = new Lang.Class({
         let homeFile = Gio.file_new_for_path (GLib.get_home_dir());
         let homeUri = homeFile.get_uri();
         let homeLabel = Shell.util_get_label_for_uri (homeUri);
-        let homeIcon = Shell.util_get_icon_for_uri (homeUri);
         this._home = new PlaceInfo('special:home', homeLabel,
-            function(size) {
-                return St.TextureCache.get_default().load_gicon(null, homeIcon, size);
-            },
             function(params) {
                 Gio.app_info_launch_default_for_uri(homeUri, _makeLaunchContext(params));
             });
@@ -144,24 +133,12 @@ const PlacesManager = new Lang.Class({
         let desktopFile = Gio.file_new_for_path (desktopPath);
         let desktopUri = desktopFile.get_uri();
         let desktopLabel = Shell.util_get_label_for_uri (desktopUri);
-        let desktopIcon = Shell.util_get_icon_for_uri (desktopUri);
         this._desktopMenu = new PlaceInfo('special:desktop', desktopLabel,
-            function(size) {
-                return St.TextureCache.get_default().load_gicon(null, desktopIcon, size);
-            },
             function(params) {
                 Gio.app_info_launch_default_for_uri(desktopUri, _makeLaunchContext(params));
             });
 
         this._connect = new PlaceInfo('special:connect', _("Connect to..."),
-            function (size) {
-                // do NOT use St.Icon here, it crashes the shell
-                // see wanda.js for details
-                return St.TextureCache.get_default().load_icon_name(null,
-                                                                    'applications-internet',
-                                                                    St.IconType.FULLCOLOR,
-                                                                    size);
-            },
             function (params) {
                 // BUG: nautilus-connect-server doesn't have a desktop file, so we can't
                 // launch it with the workspace from params. It's probably pretty rare
@@ -293,12 +270,8 @@ const PlacesManager = new Lang.Class({
                 label = Shell.util_get_label_for_uri(bookmark);
             if (label == null)
                 continue;
-            let icon = Shell.util_get_icon_for_uri(bookmark);
 
             let item = new PlaceInfo('bookmark:' + bookmark, label,
-                function(size) {
-                    return St.TextureCache.get_default().load_gicon(null, icon, size);
-                },
                 function(params) {
                     Gio.app_info_launch_default_for_uri(bookmark, _makeLaunchContext(params));
                 });
@@ -378,11 +351,7 @@ const PlaceSearchProvider = new Lang.Class({
                 metas.push(null);
             else
                 metas.push({ 'id': resultIds[i],
-                             'name': placeInfo.name,
-                             'createIcon': function(size) {
-                                 return placeInfo.iconFactory(size);
-                             }
-                           });
+                             'name': placeInfo.name });
         }
         callback(metas);
     },



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