[gnome-software/1876-gnome-software-missing-an-install-upgrade-button-when-opening-an-rpm-file] gs-app: Use 'Local file' origin string also when local-file is set



commit a05a816ea3ec2dfb2c7971669ce77757e733c929
Author: Milan Crha <mcrha redhat com>
Date:   Thu Aug 25 12:30:59 2022 +0200

    gs-app: Use 'Local file' origin string also when local-file is set
    
    The local file can be installed, in which case its correct status is 'installed',
    but that would return incorrect origin, thus use the 'Local file' also
    in these cases.

 lib/gs-app.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/lib/gs-app.c b/lib/gs-app.c
index d157ffb71..d4b3f912a 100644
--- a/lib/gs-app.c
+++ b/lib/gs-app.c
@@ -6170,7 +6170,8 @@ gs_app_dup_origin_ui (GsApp *app,
 
                if (origin_str == NULL || origin_str[0] == '\0') {
                        /* use "Local file" rather than the filename for local files */
-                       if (gs_app_get_state (app) == GS_APP_STATE_AVAILABLE_LOCAL)
+                       if (gs_app_get_state (app) == GS_APP_STATE_AVAILABLE_LOCAL ||
+                           gs_app_get_local_file (app) != NULL)
                                origin_str = _("Local file");
                        else if (g_strcmp0 (gs_app_get_origin (app), "flathub") == 0)
                                origin_str = "Flathub";


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