[gnome-software: 7/8] lib: Rename GS_PLUGIN_REFINE_FLAGS_DEFAULT to FLAGS_NONE




commit 1526acb3f524c9a59f7cfdb8ec75a8d127e91b2f
Author: Philip Withnall <pwithnall endlessos org>
Date:   Mon Dec 6 18:12:35 2021 +0000

    lib: Rename GS_PLUGIN_REFINE_FLAGS_DEFAULT to FLAGS_NONE
    
    This makes it clearer what its meaning is.
    
    It’s necessary to have a value of `GsPluginRefineFlags` which means ‘no
    refine’ so that plugin jobs can set that in their `refine-flags` for
    when they don’t want to refine.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Helps: #1472
    Fixes: #1324

 lib/gs-cmd.c                   |  4 ++--
 lib/gs-plugin-job.c            | 12 ++++++------
 lib/gs-plugin-loader.c         |  4 ++--
 lib/gs-plugin-types.h          |  4 ++--
 plugins/flatpak/gs-self-test.c |  5 ++---
 5 files changed, 14 insertions(+), 15 deletions(-)
---
diff --git a/lib/gs-cmd.c b/lib/gs-cmd.c
index 3c30f59e4..9adb5ff43 100644
--- a/lib/gs-cmd.c
+++ b/lib/gs-cmd.c
@@ -151,11 +151,11 @@ gs_cmd_parse_refine_flags (const gchar *extra, GError **error)
 {
        GsPluginRefineFlags tmp;
        guint i;
-       guint64 refine_flags = GS_PLUGIN_REFINE_FLAGS_DEFAULT;
+       guint64 refine_flags = GS_PLUGIN_REFINE_FLAGS_NONE;
        g_auto(GStrv) split = NULL;
 
        if (extra == NULL)
-               return GS_PLUGIN_REFINE_FLAGS_DEFAULT;
+               return GS_PLUGIN_REFINE_FLAGS_NONE;
 
        split = g_strsplit (extra, ",", -1);
        for (i = 0; split[i] != NULL; i++) {
diff --git a/lib/gs-plugin-job.c b/lib/gs-plugin-job.c
index a5ae1f09c..29a547043 100644
--- a/lib/gs-plugin-job.c
+++ b/lib/gs-plugin-job.c
@@ -163,14 +163,14 @@ gs_plugin_job_set_dedupe_flags (GsPluginJob *self, GsAppListFilterFlags dedupe_f
 GsPluginRefineFlags
 gs_plugin_job_get_refine_flags (GsPluginJob *self)
 {
-       g_return_val_if_fail (GS_IS_PLUGIN_JOB (self), GS_PLUGIN_REFINE_FLAGS_DEFAULT);
+       g_return_val_if_fail (GS_IS_PLUGIN_JOB (self), GS_PLUGIN_REFINE_FLAGS_NONE);
        return self->refine_flags;
 }
 
 GsPluginRefineFlags
 gs_plugin_job_get_filter_flags (GsPluginJob *self)
 {
-       g_return_val_if_fail (GS_IS_PLUGIN_JOB (self), GS_PLUGIN_REFINE_FLAGS_DEFAULT);
+       g_return_val_if_fail (GS_IS_PLUGIN_JOB (self), GS_PLUGIN_REFINE_FLAGS_NONE);
        return self->filter_flags;
 }
 
@@ -556,12 +556,12 @@ gs_plugin_job_class_init (GsPluginJobClass *klass)
        g_object_class_install_property (object_class, PROP_AGE, pspec);
 
        pspec = g_param_spec_flags ("refine-flags", NULL, NULL,
-                                   GS_TYPE_PLUGIN_REFINE_FLAGS, GS_PLUGIN_REFINE_FLAGS_DEFAULT,
+                                   GS_TYPE_PLUGIN_REFINE_FLAGS, GS_PLUGIN_REFINE_FLAGS_NONE,
                                    G_PARAM_READWRITE);
        g_object_class_install_property (object_class, PROP_REFINE_FLAGS, pspec);
 
        pspec = g_param_spec_flags ("filter-flags", NULL, NULL,
-                                   GS_TYPE_PLUGIN_REFINE_FLAGS, GS_PLUGIN_REFINE_FLAGS_DEFAULT,
+                                   GS_TYPE_PLUGIN_REFINE_FLAGS, GS_PLUGIN_REFINE_FLAGS_NONE,
                                    G_PARAM_READWRITE);
        g_object_class_install_property (object_class, PROP_FILTER_FLAGS, pspec);
 
@@ -625,8 +625,8 @@ gs_plugin_job_class_init (GsPluginJobClass *klass)
 static void
 gs_plugin_job_init (GsPluginJob *self)
 {
-       self->refine_flags = GS_PLUGIN_REFINE_FLAGS_DEFAULT;
-       self->filter_flags = GS_PLUGIN_REFINE_FLAGS_DEFAULT;
+       self->refine_flags = GS_PLUGIN_REFINE_FLAGS_NONE;
+       self->filter_flags = GS_PLUGIN_REFINE_FLAGS_NONE;
        self->dedupe_flags = GS_APP_LIST_FILTER_FLAG_KEY_ID |
                             GS_APP_LIST_FILTER_FLAG_KEY_SOURCE |
                             GS_APP_LIST_FILTER_FLAG_KEY_VERSION;
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index 733d631de..0d3ce396a 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -612,7 +612,7 @@ gs_plugin_loader_call_vfunc (GsPluginLoaderHelper *helper,
                app = gs_plugin_job_get_app (helper->plugin_job);
        if (list == NULL)
                list = gs_plugin_job_get_list (helper->plugin_job);
-       if (refine_flags == GS_PLUGIN_REFINE_FLAGS_DEFAULT)
+       if (refine_flags == GS_PLUGIN_REFINE_FLAGS_NONE)
                refine_flags = gs_plugin_job_get_refine_flags (helper->plugin_job);
 
        /* set what plugin is running on the job */
@@ -1200,7 +1200,7 @@ gs_plugin_loader_run_results (GsPluginLoaderHelper *helper,
                        return FALSE;
                }
                if (!gs_plugin_loader_call_vfunc (helper, plugin, NULL, NULL,
-                                                 GS_PLUGIN_REFINE_FLAGS_DEFAULT,
+                                                 GS_PLUGIN_REFINE_FLAGS_NONE,
                                                  cancellable, error)) {
                        return FALSE;
                }
diff --git a/lib/gs-plugin-types.h b/lib/gs-plugin-types.h
index 92a8d5f45..4d3f58489 100644
--- a/lib/gs-plugin-types.h
+++ b/lib/gs-plugin-types.h
@@ -94,7 +94,7 @@ typedef enum {
 
 /**
  * GsPluginRefineFlags:
- * @GS_PLUGIN_REFINE_FLAGS_DEFAULT:                    No explicit flags set
+ * @GS_PLUGIN_REFINE_FLAGS_NONE:                       No explicit flags set
  * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_ID:                 Require the app’s ID; this is the minimum possible 
requirement
  * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_LICENSE:            Require the license
  * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_URL:                        Require the URL
@@ -131,7 +131,7 @@ typedef enum {
  * The refine flags.
  **/
 typedef enum {
-       GS_PLUGIN_REFINE_FLAGS_DEFAULT                  = 0,
+       GS_PLUGIN_REFINE_FLAGS_NONE                     = 0,
        GS_PLUGIN_REFINE_FLAGS_REQUIRE_ID               = 1 << 0,
        GS_PLUGIN_REFINE_FLAGS_REQUIRE_LICENSE          = 1 << 1,
        GS_PLUGIN_REFINE_FLAGS_REQUIRE_URL              = 1 << 2,
diff --git a/plugins/flatpak/gs-self-test.c b/plugins/flatpak/gs-self-test.c
index d55abc86f..cad0737e5 100644
--- a/plugins/flatpak/gs-self-test.c
+++ b/plugins/flatpak/gs-self-test.c
@@ -1156,7 +1156,7 @@ flatpak_bundle_or_ref_helper (GsPluginLoader *plugin_loader,
                fn = gs_test_get_filename (TESTDATADIR, "chiron.flatpak");
                g_assert_true (fn != NULL);
                file = g_file_new_for_path (fn);
-               refine_flags = GS_PLUGIN_REFINE_FLAGS_DEFAULT;
+               refine_flags = GS_PLUGIN_REFINE_FLAGS_NONE;
        } else {
                const gchar *fn_repo = "test.flatpakrepo";
                g_autoptr(GFile) fn_repo_file = NULL;
@@ -1826,8 +1826,7 @@ gs_plugins_flatpak_runtime_extension_func (GsPluginLoader *plugin_loader)
        g_object_unref (plugin_job);
        plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_SEARCH,
                                         "search", "Bingo",
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_DEFAULT |
-                                                        GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME,
+                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_RUNTIME,
                                         NULL);
        list = gs_plugin_loader_job_process (plugin_loader, plugin_job, NULL, &error);
        gs_test_flush_main_context ();


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