[gnome-software/1131-featured-carousel: 5/21] lib: Drop GS_PLUGIN_REFINE_FLAGS_REQUIRE_KEY_COLORS refine flag




commit d30b4668916778e7c96a76be824875b70cff2f4d
Author: Philip Withnall <pwithnall endlessos org>
Date:   Fri Feb 12 18:05:17 2021 +0000

    lib: Drop GS_PLUGIN_REFINE_FLAGS_REQUIRE_KEY_COLORS refine flag
    
    It’s no longer needed. This is an API break in the libgnomesoftware
    library.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 lib/gs-cmd.c                 | 3 ++-
 lib/gs-plugin-loader.c       | 5 -----
 lib/gs-plugin-types.h        | 3 +--
 lib/gs-plugin.c              | 2 --
 plugins/dummy/gs-self-test.c | 1 -
 5 files changed, 3 insertions(+), 11 deletions(-)
---
diff --git a/lib/gs-cmd.c b/lib/gs-cmd.c
index 59234be48..73af14973 100644
--- a/lib/gs-cmd.c
+++ b/lib/gs-cmd.c
@@ -117,7 +117,8 @@ gs_cmd_refine_flag_from_string (const gchar *flag, GError **error)
        if (g_strcmp0 (flag, "review-ratings") == 0)
                return GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEW_RATINGS;
        if (g_strcmp0 (flag, "key-colors") == 0)
-               return GS_PLUGIN_REFINE_FLAGS_REQUIRE_KEY_COLORS;
+               /* no longer supported by itself; derived automatically from the icon */
+               return GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON;
        if (g_strcmp0 (flag, "icon") == 0)
                return GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON;
        if (g_strcmp0 (flag, "permissions") == 0)
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index e4a034478..2dad71f86 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -3611,11 +3611,6 @@ gs_plugin_loader_job_process_async (GsPluginLoader *plugin_loader,
        }
 
        /* FIXME: the plugins should specify this, rather than hardcoding */
-       if (gs_plugin_job_has_refine_flags (plugin_job,
-                                           GS_PLUGIN_REFINE_FLAGS_REQUIRE_KEY_COLORS)) {
-               gs_plugin_job_add_refine_flags (plugin_job,
-                                               GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON);
-       }
        if (gs_plugin_job_has_refine_flags (plugin_job,
                                            GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_UI)) {
                gs_plugin_job_add_refine_flags (plugin_job,
diff --git a/lib/gs-plugin-types.h b/lib/gs-plugin-types.h
index 9414ec390..ed81da4c9 100644
--- a/lib/gs-plugin-types.h
+++ b/lib/gs-plugin-types.h
@@ -114,7 +114,6 @@ typedef enum {
  * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROVENANCE:         Require the provenance
  * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEWS:            Require user-reviews
  * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEW_RATINGS:     Require user-ratings
- * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_KEY_COLORS:         Require the key colors
  * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON:               Require the icon to be loaded
  * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_PERMISSIONS:                Require the needed permissions
  * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_HOSTNAME:    Require the origin hostname
@@ -152,7 +151,7 @@ typedef enum {
        GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROVENANCE       = 1 << 17,
        GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEWS          = 1 << 18,
        GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEW_RATINGS   = 1 << 19,
-       GS_PLUGIN_REFINE_FLAGS_REQUIRE_KEY_COLORS       = 1 << 20,
+       /* 1 << 20 is currently unused; was previously REQUIRE_KEY_COLORS */
        GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON             = 1 << 21,
        GS_PLUGIN_REFINE_FLAGS_REQUIRE_PERMISSIONS      = 1 << 22,
        GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_HOSTNAME  = 1 << 23,
diff --git a/lib/gs-plugin.c b/lib/gs-plugin.c
index 7c332e6cc..d91cd496b 100644
--- a/lib/gs-plugin.c
+++ b/lib/gs-plugin.c
@@ -1910,8 +1910,6 @@ gs_plugin_refine_flags_to_string (GsPluginRefineFlags refine_flags)
                g_ptr_array_add (cstrs, "require-reviews");
        if (refine_flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEW_RATINGS)
                g_ptr_array_add (cstrs, "require-review-ratings");
-       if (refine_flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_KEY_COLORS)
-               g_ptr_array_add (cstrs, "require-key-colors");
        if (refine_flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON)
                g_ptr_array_add (cstrs, "require-icon");
        if (refine_flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_PERMISSIONS)
diff --git a/plugins/dummy/gs-self-test.c b/plugins/dummy/gs-self-test.c
index dbf1452ec..9ebaaea6b 100644
--- a/plugins/dummy/gs-self-test.c
+++ b/plugins/dummy/gs-self-test.c
@@ -222,7 +222,6 @@ gs_plugins_dummy_key_colors_func (GsPluginLoader *plugin_loader)
        app = gs_app_new ("zeus.desktop");
        plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REFINE,
                                         "app", app,
-                                        "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_KEY_COLORS,
                                         NULL);
        ret = gs_plugin_loader_job_action (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]