[gnome-software/mwleeds/hardcoded-pwa-list: 5/10] Allow web apps to be in UNAVAILABLE state




commit 02d6f9e749f24c1d70b85be017268bcc4204abdb
Author: Phaedrus Leeds <mwleeds protonmail com>
Date:   Thu Mar 24 13:50:20 2022 -0700

    Allow web apps to be in UNAVAILABLE state
    
    After a web app is uninstalled in Software, it is only re-installable if
    it is present in the AppStream data. Otherwise the app must have been
    installed via Epiphany, and the information needed to re-install it
    (e.g. the icon) is not available. If we leave the state as
    GS_APP_STATE_UNKNOWN after the removal, the user is greeted by an ugly
    message "Unable to find org.gnome.Epiphany.WebApp_...." in place of the
    details page. So set the state to GS_APP_STATE_UNAVAILABLE instead, and
    update other parts of Software to allow that state to mean "Don't show
    any Install/Remove/Open button" when it is set on a web app.

 plugins/epiphany/gs-plugin-epiphany.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/plugins/epiphany/gs-plugin-epiphany.c b/plugins/epiphany/gs-plugin-epiphany.c
index 385ebf813..133d9a215 100644
--- a/plugins/epiphany/gs-plugin-epiphany.c
+++ b/plugins/epiphany/gs-plugin-epiphany.c
@@ -386,6 +386,11 @@ gs_epiphany_refine_app_state (GsPlugin *plugin,
                        gs_app_set_state (app, gs_app_get_state (cached_app));
                else if (appstream_source)
                        gs_app_set_state (app, GS_APP_STATE_AVAILABLE);
+               else {
+                       gs_app_set_state (app, GS_APP_STATE_UNAVAILABLE);
+                       gs_app_set_url_missing (app,
+                                               
"https://gitlab.gnome.org/GNOME/gnome-software/-/wikis/How-to-reinstall-a-web-app";);
+               }
        }
 }
 


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