[recipes] search provider: Use the default image



commit 411fcecf07613b4c079c165a1241179fb1e91b79
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Mar 11 00:04:54 2017 -0500

    search provider: Use the default image
    
    We don't want to hardcode image 0 anyway, since we now
    have the default image property.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=779636

 src/gr-shell-search-provider.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/src/gr-shell-search-provider.c b/src/gr-shell-search-provider.c
index 5df50a4..5110b70 100644
--- a/src/gr-shell-search-provider.c
+++ b/src/gr-shell-search-provider.c
@@ -171,11 +171,9 @@ gr_recipe_get_pixbuf (GrRecipe *recipe)
         g_object_get (recipe, "images", &images, NULL);
 
         if (images->len > 0) {
-                GrImage *ri = &g_array_index (images, GrImage, 0);
-                GdkPixbuf *pixbuf;
-
-                pixbuf = load_pixbuf_fill_size (ri->path, 64, 64);
-                return pixbuf;
+                int index = gr_recipe_get_default_image (recipe);
+                GrImage *ri = &g_array_index (images, GrImage, index);
+                return load_pixbuf_fill_size (ri->path, 64, 64);
         }
 
         return NULL;


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