[gnome-software/mwleeds/hardcoded-pwa-list] WIP



commit 92645d096cea4ee03ab0a7055a37c645020a1bbd
Author: Phaedrus Leeds <mwleeds protonmail com>
Date:   Wed Mar 9 18:49:05 2022 -0800

    WIP

 lib/gs-app.c                          | 5 ++++-
 plugins/core/gs-plugin-icons.c        | 2 +-
 plugins/epiphany/gs-plugin-epiphany.c | 2 ++
 src/gs-app-context-bar.c              | 3 ++-
 4 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/lib/gs-app.c b/lib/gs-app.c
index 3e605a209..042c00f89 100644
--- a/lib/gs-app.c
+++ b/lib/gs-app.c
@@ -3523,7 +3523,8 @@ gs_app_add_provided_item (GsApp *app, AsProvidedKind kind, const gchar *item)
  *
  * Get the value of #GsApp:size-download.
  *
- * Returns: number of bytes, `0` for unknown, or %GS_APP_SIZE_UNKNOWABLE for invalid
+ * Returns: number of bytes, `0` for unknown, `1` for no download required, or
+ *   %GS_APP_SIZE_UNKNOWABLE for invalid
  *
  * Since: 3.22
  **/
@@ -3545,6 +3546,8 @@ gs_app_get_size_download (GsApp *app)
  * Sets the download size of the application, not including any
  * required runtime.
  *
+ * If @size_download is 1, this is considered to mean no download is required.
+ *
  * Since: 3.22
  **/
 void
diff --git a/plugins/core/gs-plugin-icons.c b/plugins/core/gs-plugin-icons.c
index 0e1987977..d887456eb 100644
--- a/plugins/core/gs-plugin-icons.c
+++ b/plugins/core/gs-plugin-icons.c
@@ -46,7 +46,7 @@ gs_plugin_icons_init (GsPluginIcons *self)
 {
        /* needs remote icons downloaded */
        gs_plugin_add_rule (GS_PLUGIN (self), GS_PLUGIN_RULE_RUN_AFTER, "appstream");
-       gs_plugin_add_rule (GS_PLUGIN (self), GS_PLUGIN_RULE_RUN_AFTER, "epiphany");
+       //gs_plugin_add_rule (GS_PLUGIN (self), GS_PLUGIN_RULE_RUN_AFTER, "epiphany");
 }
 
 static void
diff --git a/plugins/epiphany/gs-plugin-epiphany.c b/plugins/epiphany/gs-plugin-epiphany.c
index 5b8333df5..a7a1ac663 100644
--- a/plugins/epiphany/gs-plugin-epiphany.c
+++ b/plugins/epiphany/gs-plugin-epiphany.c
@@ -311,6 +311,7 @@ gs_plugin_epiphany_init (GsPluginEpiphany *self)
 
        /* need help from appstream */
        gs_plugin_add_rule (GS_PLUGIN (self), GS_PLUGIN_RULE_RUN_AFTER, "appstream");
+       gs_plugin_add_rule (GS_PLUGIN (self), GS_PLUGIN_RULE_RUN_AFTER, "icons");
 
        /* prioritize over packages */
        gs_plugin_add_rule (GS_PLUGIN (self), GS_PLUGIN_RULE_BETTER_THAN, "packagekit");
@@ -546,6 +547,7 @@ list_installed_apps_thread_cb (GTask        *task,
                gs_app_set_state (app, GS_APP_STATE_INSTALLED);
                gs_app_set_name (app, GS_APP_QUALITY_NORMAL, name);
                gs_app_set_url (app, AS_URL_KIND_HOMEPAGE, url);
+               gs_app_set_launchable (app, AS_LAUNCHABLE_KIND_URL, url);
                gs_app_set_permissions (app, GS_APP_PERMISSIONS_NETWORK);
 
                refine_app_from_uri (app, uri, url);
diff --git a/src/gs-app-context-bar.c b/src/gs-app-context-bar.c
index ea1e8938f..cf2f235e2 100644
--- a/src/gs-app-context-bar.c
+++ b/src/gs-app-context-bar.c
@@ -199,7 +199,8 @@ update_storage_tile (GsAppContextBar *self)
                 * This is displayed in a context tile, so the string should be short. */
                description = g_strdup (_("Size is unknown"));
        } else {
-               lozenge_text = g_format_size (size_bytes);
+               /* Treat 1 byte as meaning "no download needed" */
+               lozenge_text = g_format_size (size_bytes == 1 ? 0 : size_bytes);
        }
 
        gtk_label_set_text (GTK_LABEL (self->tiles[STORAGE_TILE].lozenge_content), lozenge_text);


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