[gnome-software/mwleeds/pwa-plugin: 132/132] fixup! Revive webapp support




commit de79d653204782a8f388a1502c8dbd7506c3e1a6
Author: Phaedrus Leeds <mwleeds protonmail com>
Date:   Tue Feb 15 15:23:58 2022 -0800

    fixup! Revive webapp support

 plugins/epiphany/gs-plugin-epiphany.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/plugins/epiphany/gs-plugin-epiphany.c b/plugins/epiphany/gs-plugin-epiphany.c
index 8547586ef..277e24f78 100644
--- a/plugins/epiphany/gs-plugin-epiphany.c
+++ b/plugins/epiphany/gs-plugin-epiphany.c
@@ -390,7 +390,7 @@ list_installed_apps_thread_cb (GTask        *task,
                 * FIXME: Fetch the summary from the site's webapp manifest.
                 */
                host = g_uri_get_host (uri);
-               gs_app_set_summary (app, host ? host : url);
+               gs_app_set_summary (app, GS_APP_QUALITY_LOWEST, host ? host : url);
 
                if (icon_path) {
                        g_autoptr(GFile) icon_file = g_file_new_for_path (icon_path);
@@ -442,7 +442,6 @@ gs_plugin_app_install (GsPlugin      *plugin,
        GsPluginEpiphany *self = GS_PLUGIN_EPIPHANY (plugin);
        const char *url;
        const char *name;
-       const char *icon_format;
        g_autofree char *token = NULL;
        GPtrArray *icons;
        g_autoptr(GVariant) token_v = NULL;
@@ -480,14 +479,14 @@ gs_plugin_app_install (GsPlugin      *plugin,
                        g_autoptr(GIcon) bytes_icon = NULL;
 
                        icon_path = g_file_get_path (g_file_icon_get_file (G_FILE_ICON (icon)));
-                       if (g_str_has_suffix (icon_path, ".png"))
-                               icon_format = "png";
-                       else if (g_str_has_suffix (icon_path, ".svg"))
-                               icon_format = "svg";
-                       else if (g_str_has_suffix (icon_path, ".jpeg") || g_str_has_suffix (icon_path, 
".jpg"))
-                               icon_format = "jpeg";
-                       else
+                       if (!g_str_has_suffix (icon_path, ".png") &&
+                           !g_str_has_suffix (icon_path, ".svg") &&
+                           !g_str_has_suffix (icon_path, ".jpeg") &&
+                           !g_str_has_suffix (icon_path, ".jpg")) {
+                               g_warning ("Icon for app %s has unsupported file extension: %s",
+                                          gs_app_get_id (app), icon_path);
                                continue;
+                       }
 
                        /* Serialize the icon as a #GBytesIcon since that's
                         * what the dynamic launcher portal requires.


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