[gnome-control-center/applications-fallback-app-icon: 3/3] applications: Use "application-x-executable" when app has no icon
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/applications-fallback-app-icon: 3/3] applications: Use "application-x-executable" when app has no icon
- Date: Sun, 17 Nov 2019 22:56:38 +0000 (UTC)
commit 0b91c023772e118838b44a20d6c00fd22e504d47
Author: Felipe Borges <felipeborges gnome org>
Date: Fri Nov 15 14:05:58 2019 +0100
applications: Use "application-x-executable" when app has no icon
panels/applications/cc-applications-row.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/panels/applications/cc-applications-row.c b/panels/applications/cc-applications-row.c
index 02a5208f9..08516ac62 100644
--- a/panels/applications/cc-applications-row.c
+++ b/panels/applications/cc-applications-row.c
@@ -75,6 +75,7 @@ cc_applications_row_new (GAppInfo *info)
{
CcApplicationsRow *self;
g_autofree gchar *key = NULL;
+ GIcon *icon;
self = g_object_new (CC_TYPE_APPLICATIONS_ROW, NULL);
@@ -83,7 +84,12 @@ cc_applications_row_new (GAppInfo *info)
key = g_utf8_casefold (g_app_info_get_display_name (info), -1);
self->sortkey = g_utf8_collate_key (key, -1);
- gtk_image_set_from_gicon (GTK_IMAGE (self->image), g_app_info_get_icon (info), GTK_ICON_SIZE_BUTTON);
+ icon = g_app_info_get_icon (info);
+ if (icon != NULL)
+ gtk_image_set_from_gicon (GTK_IMAGE (self->image), g_app_info_get_icon (info), GTK_ICON_SIZE_BUTTON);
+ else
+ gtk_image_set_from_icon_name (GTK_IMAGE (self->image), "application-x-executable", GTK_ICON_SIZE_BUTTON);
+
gtk_label_set_label (GTK_LABEL (self->label), g_app_info_get_display_name (info));
return self;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]