[gnome-builder] greeter: connect project info icon to image



commit 2a69275646ab23ec5992b762abb2ed25001d9e27
Author: Christian Hergert <chergert redhat com>
Date:   Mon Jan 21 18:23:27 2019 -0800

    greeter: connect project info icon to image

 src/libide/greeter/ide-greeter-row.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/src/libide/greeter/ide-greeter-row.c b/src/libide/greeter/ide-greeter-row.c
index d0bca4695..1447e3fa9 100644
--- a/src/libide/greeter/ide-greeter-row.c
+++ b/src/libide/greeter/ide-greeter-row.c
@@ -324,12 +324,16 @@ ide_greeter_row_set_project_info (IdeGreeterRow  *self,
           const gchar *build_system = ide_project_info_get_build_system_name (project_info);
           GFile *directory = ide_project_info_get_directory (project_info);
           const gchar *desc = ide_project_info_get_description (project_info);
+          GIcon *icon = ide_project_info_get_icon (project_info);
 
           if (!ide_str_empty0 (desc))
             gtk_widget_set_tooltip_text (GTK_WIDGET (self), desc);
 
-          if ((collapsed = ide_path_collapse (g_file_peek_path (directory))))
-            desc = collapsed;
+          if (directory != NULL)
+            {
+              if ((collapsed = ide_path_collapse (g_file_peek_path (directory))))
+                desc = collapsed;
+            }
 
           gtk_label_set_label (priv->title, name);
           gtk_label_set_label (priv->subtitle, desc);
@@ -341,8 +345,15 @@ ide_greeter_row_set_project_info (IdeGreeterRow  *self,
             {
               qsort (languages, g_strv_length (languages), sizeof (gchar*), compare_language);
               for (guint i = 0; languages[i] != NULL; i++)
-                ide_greeter_row_add_tag (self, languages[i], TAG_LANGUAGE);
+                ide_greeter_row_add_tag (self, g_strstrip (languages[i]), TAG_LANGUAGE);
             }
+
+          if (icon != NULL)
+            g_object_set (priv->image,
+                          "pixel-size", 32,
+                          "gicon", icon,
+                          "visible", icon != NULL,
+                          NULL);
         }
 
       g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_PROJECT_INFO]);


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