[gnome-software/1876-gnome-software-missing-an-install-upgrade-button-when-opening-an-rpm-file] gs-origin-popover-row: Use local file as source is set



commit 1c09ad9424dbada901203ea41c9cd0f816dd4a58
Author: Milan Crha <mcrha redhat com>
Date:   Thu Aug 25 12:36:27 2022 +0200

    gs-origin-popover-row: Use local file as source is set
    
    The local file can be installed, in which case the state is not enough
    to know the GsApp:local-file is usable, thus have the GsApp:local-file
    property as another indication that the source is from a file.

 src/gs-origin-popover-row.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/gs-origin-popover-row.c b/src/gs-origin-popover-row.c
index 27f76ea12..adfb539d7 100644
--- a/src/gs-origin-popover-row.c
+++ b/src/gs-origin-popover-row.c
@@ -49,7 +49,8 @@ refresh_ui (GsOriginPopoverRow *row)
        if (origin_ui != NULL)
                gtk_label_set_text (GTK_LABEL (priv->name_label), origin_ui);
 
-       if (gs_app_get_state (priv->app) == GS_APP_STATE_AVAILABLE_LOCAL) {
+       if (gs_app_get_state (priv->app) == GS_APP_STATE_AVAILABLE_LOCAL ||
+           gs_app_get_local_file (priv->app) != NULL) {
                GFile *local_file = gs_app_get_local_file (priv->app);
                url = g_file_get_basename (local_file);
        } else {


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