[gnome-software: 2/3] Always check for 64x64@1 icons
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 2/3] Always check for 64x64@1 icons
- Date: Tue, 8 Feb 2022 17:38:56 +0000 (UTC)
commit 79618e226552b6e95f159b48cf15bf9c0b36d291
Author: Robert Ancell <robert ancell canonical com>
Date: Tue Feb 8 09:53:00 2022 +1300
Always check for 64x64@1 icons
lib/gs-app.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/lib/gs-app.c b/lib/gs-app.c
index 8905db05e..012aeded1 100644
--- a/lib/gs-app.c
+++ b/lib/gs-app.c
@@ -1887,13 +1887,14 @@ gs_app_get_icon_for_size (GsApp *app,
GIcon *icon = priv->icons->pdata[i];
g_autofree gchar *icon_str = g_icon_to_string (icon);
guint icon_width = gs_icon_get_width (icon);
+ guint icon_height = gs_icon_get_height (icon);
guint icon_scale = gs_icon_get_scale (icon);
g_debug ("\tConsidering icon of type %s (%s), width %u×%u",
G_OBJECT_TYPE_NAME (icon), icon_str, icon_width, icon_scale);
- /* Ignore icons that aren't in the cache - Appstream doesn't require them to be present */
- if (G_IS_FILE_ICON (icon)) {
+ /* Appstream only guarantees the 64x64@1 cached icon is present, ignore other icons that
aren't installed. */
+ if (G_IS_FILE_ICON (icon) && !(icon_width == 64 && icon_height == 64 && icon_scale == 1)) {
GFile *file = g_file_icon_get_file (G_FILE_ICON (icon));
if (!g_file_query_exists (file, NULL)) {
continue;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]