[gnome-software: 21/24] gs-plugin-types: Drop GS_PLUGIN_ACTION_GET_RECENT




commit c879ecf249cf2051ef85529128ab7caa3ef2b781
Author: Philip Withnall <pwithnall endlessos org>
Date:   Wed Apr 13 22:52:20 2022 +0100

    gs-plugin-types: Drop GS_PLUGIN_ACTION_GET_RECENT
    
    It’s no longer used.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Helps: #1472

 doc/vendor-customisation.md |  3 ++-
 lib/gs-plugin-loader.c      | 35 -----------------------------------
 lib/gs-plugin-types.h       |  2 --
 lib/gs-plugin-vfuncs.h      | 20 --------------------
 lib/gs-plugin.c             |  6 ------
 5 files changed, 2 insertions(+), 64 deletions(-)
---
diff --git a/doc/vendor-customisation.md b/doc/vendor-customisation.md
index b1d1b4481..d7a7ba4b4 100644
--- a/doc/vendor-customisation.md
+++ b/doc/vendor-customisation.md
@@ -85,7 +85,8 @@ Both pages also have a “New & Updated” section (`box_recent` or
 listed in the new and updated section are not curated: they are chosen as the
 applications which have had a recent release, according to the
 `component/releases/release[@timestamp]` attribute in their metainfo.
-Technically these are the results of the `gs_plugin_add_recent()` vfunc.
+Technically these are the results of a `GsPlugin.list_apps_async()` query with
+`GsAppQuery:released-since` set.
 
 Applications are included in any of the curated sets through having special
 metadata in their metainfo. The required metadata is different for the different
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index b9db3d3b4..0b0528069 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -648,14 +648,6 @@ gs_plugin_loader_call_vfunc (GsPluginLoaderHelper *helper,
                        ret = plugin_func (plugin, app, cancellable, &error_local);
                }
                break;
-       case GS_PLUGIN_ACTION_GET_RECENT:
-               {
-                       GsPluginGetRecentFunc plugin_func = func;
-                       ret = plugin_func (plugin, list,
-                                          gs_plugin_job_get_age (helper->plugin_job),
-                                          cancellable, &error_local);
-               }
-               break;
        case GS_PLUGIN_ACTION_GET_UPDATES:
        case GS_PLUGIN_ACTION_GET_UPDATES_HISTORICAL:
        case GS_PLUGIN_ACTION_GET_SOURCES:
@@ -1081,18 +1073,6 @@ gs_plugin_loader_filter_qt_for_gtk (GsApp *app, gpointer user_data)
        return TRUE;
 }
 
-static gboolean
-gs_plugin_loader_app_is_non_compulsory (GsApp *app, gpointer user_data)
-{
-       return !gs_app_has_quirk (app, GS_APP_QUIRK_COMPULSORY);
-}
-
-static gboolean
-gs_plugin_loader_app_is_desktop (GsApp *app, gpointer user_data)
-{
-       return gs_app_get_kind (app) == AS_COMPONENT_KIND_DESKTOP_APP;
-}
-
 gboolean
 gs_plugin_loader_app_is_compatible (GsPluginLoader *plugin_loader,
                                     GsApp          *app)
@@ -3482,13 +3462,6 @@ gs_plugin_loader_process_thread_cb (GTask *task,
                }
        }
 
-       if (action == GS_PLUGIN_ACTION_GET_RECENT) {
-               /* Preliminary filter recent apps, to have truncated a meaningful list */
-               gs_app_list_filter_duplicates (list, GS_APP_LIST_FILTER_FLAG_KEY_ID);
-               gs_app_list_filter (list, gs_plugin_loader_app_is_non_compulsory, NULL);
-               gs_app_list_filter (list, gs_plugin_loader_app_is_desktop, NULL);
-       }
-
        /* filter to reduce to a sane set */
        gs_plugin_loader_job_sorted_truncation (helper->plugin_job, list);
 
@@ -3631,13 +3604,6 @@ gs_plugin_loader_process_thread_cb (GTask *task,
        case GS_PLUGIN_ACTION_GET_UPDATES:
                gs_app_list_filter (list, gs_plugin_loader_app_is_valid_updatable, helper);
                break;
-       case GS_PLUGIN_ACTION_GET_RECENT:
-               gs_app_list_filter (list, gs_plugin_loader_app_is_non_compulsory, NULL);
-               gs_app_list_filter (list, gs_plugin_loader_app_is_desktop, NULL);
-               gs_app_list_filter (list, gs_plugin_loader_app_is_valid_filter, helper);
-               gs_app_list_filter (list, gs_plugin_loader_filter_qt_for_gtk, NULL);
-               gs_app_list_filter (list, gs_plugin_loader_get_app_is_compatible, plugin_loader);
-               break;
        case GS_PLUGIN_ACTION_GET_POPULAR:
                gs_app_list_filter (list, gs_plugin_loader_app_is_valid_filter, helper);
                gs_app_list_filter (list, gs_plugin_loader_filter_qt_for_gtk, NULL);
@@ -4185,7 +4151,6 @@ job_process_cb (GTask *task)
        case GS_PLUGIN_ACTION_GET_CATEGORY_APPS:
        case GS_PLUGIN_ACTION_GET_FEATURED:
        case GS_PLUGIN_ACTION_GET_POPULAR:
-       case GS_PLUGIN_ACTION_GET_RECENT:
        case GS_PLUGIN_ACTION_SEARCH:
        case GS_PLUGIN_ACTION_SEARCH_PROVIDES:
                if (gs_plugin_job_get_timeout (plugin_job) > 0) {
diff --git a/lib/gs-plugin-types.h b/lib/gs-plugin-types.h
index 1a412a78c..fa02a7f76 100644
--- a/lib/gs-plugin-types.h
+++ b/lib/gs-plugin-types.h
@@ -265,7 +265,6 @@ typedef enum {
  * @GS_PLUGIN_ACTION_GET_CATEGORY_APPS:                Get the apps for a specific category
  * @GS_PLUGIN_ACTION_FILE_TO_APP:              Convert the file to an application
  * @GS_PLUGIN_ACTION_URL_TO_APP:               Convert the URI to an application
- * @GS_PLUGIN_ACTION_GET_RECENT:               Get the apps recently released
  * @GS_PLUGIN_ACTION_GET_UPDATES_HISTORICAL:    Get the list of historical updates
  * @GS_PLUGIN_ACTION_DOWNLOAD:                 Download an application
  * @GS_PLUGIN_ACTION_GET_ALTERNATES:           Get the alternates for a specific application
@@ -296,7 +295,6 @@ typedef enum {
        GS_PLUGIN_ACTION_GET_CATEGORY_APPS,
        GS_PLUGIN_ACTION_FILE_TO_APP,
        GS_PLUGIN_ACTION_URL_TO_APP,
-       GS_PLUGIN_ACTION_GET_RECENT,
        GS_PLUGIN_ACTION_GET_UPDATES_HISTORICAL,
        GS_PLUGIN_ACTION_DOWNLOAD,
        GS_PLUGIN_ACTION_GET_ALTERNATES,
diff --git a/lib/gs-plugin-vfuncs.h b/lib/gs-plugin-vfuncs.h
index 23288f941..008ba7fe4 100644
--- a/lib/gs-plugin-vfuncs.h
+++ b/lib/gs-plugin-vfuncs.h
@@ -223,26 +223,6 @@ gboolean    gs_plugin_add_category_apps            (GsPlugin       *plugin,
                                                         GCancellable   *cancellable,
                                                         GError         **error);
 
-/**
- * gs_plugin_add_recent:
- * @plugin: a #GsPlugin
- * @list: a #GsAppList
- * @age: a number of seconds
- * @cancellable: a #GCancellable, or %NULL
- * @error: a #GError, or %NULL
- *
- * Return all the applications that have had upstream releases recently.
- *
- * Plugins are expected to add new apps using gs_app_list_add().
- *
- * Returns: %TRUE for success or if not relevant
- **/
-gboolean        gs_plugin_add_recent                   (GsPlugin       *plugin,
-                                                        GsAppList      *list,
-                                                        guint64         age,
-                                                        GCancellable   *cancellable,
-                                                        GError         **error);
-
 /**
  * gs_plugin_add_popular:
  * @plugin: a #GsPlugin
diff --git a/lib/gs-plugin.c b/lib/gs-plugin.c
index d52af4ff9..4c491958e 100644
--- a/lib/gs-plugin.c
+++ b/lib/gs-plugin.c
@@ -1465,8 +1465,6 @@ gs_plugin_action_to_function_name (GsPluginAction action)
                return "gs_plugin_add_updates";
        if (action == GS_PLUGIN_ACTION_GET_POPULAR)
                return "gs_plugin_add_popular";
-       if (action == GS_PLUGIN_ACTION_GET_RECENT)
-               return "gs_plugin_add_recent";
        if (action == GS_PLUGIN_ACTION_SEARCH)
                return "gs_plugin_add_search";
        if (action == GS_PLUGIN_ACTION_SEARCH_PROVIDES)
@@ -1539,8 +1537,6 @@ gs_plugin_action_to_string (GsPluginAction action)
                return "file-to-app";
        if (action == GS_PLUGIN_ACTION_URL_TO_APP)
                return "url-to-app";
-       if (action == GS_PLUGIN_ACTION_GET_RECENT)
-               return "get-recent";
        if (action == GS_PLUGIN_ACTION_GET_UPDATES_HISTORICAL)
                return "get-updates-historical";
        if (action == GS_PLUGIN_ACTION_GET_ALTERNATES)
@@ -1607,8 +1603,6 @@ gs_plugin_action_from_string (const gchar *action)
                return GS_PLUGIN_ACTION_FILE_TO_APP;
        if (g_strcmp0 (action, "url-to-app") == 0)
                return GS_PLUGIN_ACTION_URL_TO_APP;
-       if (g_strcmp0 (action, "get-recent") == 0)
-               return GS_PLUGIN_ACTION_GET_RECENT;
        if (g_strcmp0 (action, "get-updates-historical") == 0)
                return GS_PLUGIN_ACTION_GET_UPDATES_HISTORICAL;
        if (g_strcmp0 (action, "get-alternates") == 0)


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