[gnome-documents] searchProvider: Fix thumbnails for non-serializable gicons



commit d8e40f42d60e2a3384526d4ef1eb097c4ba9b8a9
Author: Florian MÃllner <fmuellner gnome org>
Date:   Tue Jul 31 17:15:08 2012 +0200

    searchProvider: Fix thumbnails for non-serializable gicons
    
    g_icon_get_string() may return NULL, depending on whether the icon
    allows serialization or not. Handle that case instead of assuming
    that having a gicon implies that we can send it over the bus.

 src/shellSearchProvider.js |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/shellSearchProvider.js b/src/shellSearchProvider.js
index 818cb47..4a69e0d 100644
--- a/src/shellSearchProvider.js
+++ b/src/shellSearchProvider.js
@@ -427,8 +427,9 @@ const ShellSearchProvider = new Lang.Class({
 
             let gicon = this._cache[id].icon;
             let pixbuf = this._cache[id].pixbuf;
-            if (gicon)
-                meta['gicon'] = GLib.Variant.new('s', gicon.to_string());
+            let iconstr = gicon ? gicon.to_string() : null;
+            if (iconstr)
+                meta['gicon'] = GLib.Variant.new('s', iconstr);
             else if (pixbuf)
                 meta['icon-data'] = Gd.create_variant_from_pixbuf(pixbuf);
 



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