[gnome-software/wip/mcrha/m762-to-gnome-40] gs-details-page: Harmonize used refine flags



commit abf594d5ce37a259c7e825b068a0d4cc62f66c94
Author: Milan Crha <mcrha redhat com>
Date:   Wed Jul 7 12:49:52 2021 +0200

    gs-details-page: Harmonize used refine flags
    
    Use the same refine flags asking for the information needed by the page
    in all calls which use it (except added flag in the set_url()).

 src/gs-details-page.c | 82 ++++++++++++++++-----------------------------------
 1 file changed, 25 insertions(+), 57 deletions(-)
---
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index b270e3afa..6190cc392 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -33,6 +33,27 @@
 /* the number of reviews to show before clicking the 'More Reviews' button */
 #define SHOW_NR_REVIEWS_INITIAL                4
 
+#define GS_DETAILS_PAGE_REFINE_FLAGS   GS_PLUGIN_REFINE_FLAGS_REQUIRE_ADDONS | \
+                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_CATEGORIES | \
+                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_CONTENT_RATING | \
+                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_DESCRIPTION | \
+                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_DEVELOPER_NAME | \
+                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_HISTORY | \
+                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON | \
+                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_KUDOS | \
+                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_LICENSE | \
+                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_HOSTNAME | \
+                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_PERMISSIONS | \
+                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROJECT_GROUP | \
+                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROVENANCE | \
+                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_RELATED | \
+                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME | \
+                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_SCREENSHOTS | \
+                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_SETUP_ACTION | \
+                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_SIZE | \
+                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_URL | \
+                                       GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION
+
 static void gs_details_page_refresh_all (GsDetailsPage *self);
 static void gs_details_page_refresh_buttons (GsDetailsPage *self);
 
@@ -2004,8 +2025,7 @@ gs_details_page_load_stage2 (GsDetailsPage *self)
        plugin_job2 = gs_plugin_job_newv (GS_PLUGIN_ACTION_GET_ALTERNATES,
                                          "interactive", TRUE,
                                          "app", self->app,
-                                         "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_HOSTNAME |
-                                                         GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROVENANCE,
+                                         "refine-flags", GS_DETAILS_PAGE_REFINE_FLAGS,
                                          "dedupe-flags", GS_APP_LIST_FILTER_FLAG_NONE,
                                          NULL);
        gs_plugin_loader_job_process_async (self->plugin_loader, plugin_job1,
@@ -2121,24 +2141,7 @@ gs_details_page_set_local_file (GsDetailsPage *self, GFile *file)
        gs_details_page_set_header_label (self, _("Loading…"));
        plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_FILE_TO_APP,
                                         "file", file,
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_LICENSE |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_SIZE |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_HISTORY |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_HOSTNAME |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_CATEGORIES |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_URL |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_SETUP_ACTION |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROVENANCE |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_RELATED |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_PERMISSIONS |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROJECT_GROUP |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_DEVELOPER_NAME |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_KUDOS |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_CONTENT_RATING |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_SCREENSHOTS,
+                                        "refine-flags", GS_DETAILS_PAGE_REFINE_FLAGS,
                                         NULL);
        gs_plugin_loader_job_process_async (self->plugin_loader, plugin_job,
                                            self->cancellable,
@@ -2156,24 +2159,7 @@ gs_details_page_set_url (GsDetailsPage *self, const gchar *url)
        gs_details_page_set_header_label (self, _("Loading…"));
        plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_URL_TO_APP,
                                         "search", url,
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_LICENSE |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_SIZE |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_HISTORY |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_HOSTNAME |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_CATEGORIES |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_URL |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_SETUP_ACTION |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROVENANCE |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_RELATED |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_PERMISSIONS |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROJECT_GROUP |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_DEVELOPER_NAME |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_KUDOS |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_SCREENSHOTS |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_CONTENT_RATING |
+                                        "refine-flags", GS_DETAILS_PAGE_REFINE_FLAGS |
                                                         GS_PLUGIN_REFINE_FLAGS_ALLOW_PACKAGES,
                                         NULL);
        gs_plugin_loader_job_process_async (self->plugin_loader, plugin_job,
@@ -2195,25 +2181,7 @@ gs_details_page_load_stage1 (GsDetailsPage *self)
        /* get extra details about the app */
        plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
                                         "app", self->app,
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_PERMISSIONS |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_LICENSE |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_HISTORY |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_SETUP_ACTION |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_HOSTNAME |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_CATEGORIES |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_URL |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_DESCRIPTION |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_SETUP_ACTION |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROVENANCE |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_ADDONS |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROJECT_GROUP |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_DEVELOPER_NAME |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_KUDOS |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_CONTENT_RATING |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_SCREENSHOTS,
+                                        "refine-flags", GS_DETAILS_PAGE_REFINE_FLAGS,
                                         NULL);
        gs_plugin_loader_job_process_async (self->plugin_loader, plugin_job,
                                            self->cancellable,


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