[gnome-software/1268-appstream-urls-not-properly-supported: 1/5] gs-details-page: Match unknown bundle-kind/scope when checking alternates




commit 1fee595b8b4524f972cf16106e3654260e3a05cf
Author: Milan Crha <mcrha redhat com>
Date:   Thu Jul 29 14:25:29 2021 +0200

    gs-details-page: Match unknown bundle-kind/scope when checking alternates
    
    When all values match except of the bundle kind or the scope due to
    the alternative app having either or both of them set as unknown, then
    it could result in no Source being checked (selected) in the GUI.
    Observed this with a Snap application found by url-to-app.

 src/gs-details-page.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index 7f8f2b9d8..bf9e5acb9 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -773,8 +773,10 @@ gs_details_page_get_alternates_cb (GObject *source_object,
                GtkWidget *row = gs_origin_popover_row_new (app);
                gtk_widget_show (row);
                if (app == self->app || (
-                   gs_app_get_bundle_kind (app) == gs_app_get_bundle_kind (self->app) &&
-                   gs_app_get_scope (app) == gs_app_get_scope (self->app) &&
+                   (gs_app_get_bundle_kind (app) == AS_BUNDLE_KIND_UNKNOWN ||
+                   gs_app_get_bundle_kind (app) == gs_app_get_bundle_kind (self->app)) &&
+                   (gs_app_get_scope (app) == AS_COMPONENT_SCOPE_UNKNOWN ||
+                   gs_app_get_scope (app) == gs_app_get_scope (self->app)) &&
                    g_strcmp0 (gs_app_get_origin (app), gs_app_get_origin (self->app)) == 0 &&
                    g_strcmp0 (gs_app_get_branch (app), gs_app_get_branch (self->app)) == 0 &&
                    g_strcmp0 (gs_app_get_version (app), gs_app_get_version (self->app)) == 0)) {


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