[gnome-shell] remoteSearch: Use GIcon for loading icon data



commit 428876123579589a228770faab57887169fea343
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Jan 2 09:31:50 2013 -0500

    remoteSearch: Use GIcon for loading icon data
    
    This removes us from caching the pixbuf data in the icon cache,
    and allows us to remove St.TextureCache.load_from_raw().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=691019

 js/ui/remoteSearch.js |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/remoteSearch.js b/js/ui/remoteSearch.js
index 9ac6972..507da71 100644
--- a/js/ui/remoteSearch.js
+++ b/js/ui/remoteSearch.js
@@ -4,6 +4,7 @@ const Gio = imports.gi.Gio;
 const GLib = imports.gi.GLib;
 const Lang = imports.lang;
 const St = imports.gi.St;
+const Shell = imports.gi.Shell;
 
 const FileUtils = imports.misc.fileUtils;
 const Search = imports.ui.search;
@@ -187,18 +188,18 @@ const RemoteSearchProvider = new Lang.Class({
     },
 
     createIcon: function(size, meta) {
+        let gicon;
         if (meta['gicon']) {
-            return new St.Icon({ gicon: Gio.icon_new_for_string(meta['gicon']),
-                                 icon_size: size });
+            gicon = Gio.icon_new_for_string(meta['gicon']);
         } else if (meta['icon-data']) {
             let [width, height, rowStride, hasAlpha,
                  bitsPerSample, nChannels, data] = meta['icon-data'];
-            let textureCache = St.TextureCache.get_default();
-            return textureCache.load_from_raw(data, hasAlpha,
-                                              width, height, rowStride, size);
+            gicon = Shell.util_create_pixbuf_from_data(data, GdkPixbuf.Colorspace.RGB, hasAlpha,
+                                                       bitsPerSample, width, height, rowStride);
         }
 
-        return null;
+        return new St.Icon({ gicon: Gio.icon_new_for_string(meta['gicon']),
+                             icon_size: size });
     },
 
     _getResultsFinished: function(results, error) {



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