[gnome-software: 9/14] gs-plugin-types: Drop GS_PLUGIN_ACTION_GET_INSTALLED




commit 39796f2fd84b6491aeafe00d85783d1218472905
Author: Philip Withnall <pwithnall endlessos org>
Date:   Thu Dec 9 17:08:59 2021 +0000

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

 lib/gs-plugin-loader.c | 43 -------------------------------------------
 lib/gs-plugin-types.h  |  2 --
 lib/gs-plugin-vfuncs.h | 18 ------------------
 lib/gs-plugin.c        |  6 ------
 4 files changed, 69 deletions(-)
---
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index 7dc706bad..8120ed78c 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -652,7 +652,6 @@ gs_plugin_loader_call_vfunc (GsPluginLoaderHelper *helper,
        case GS_PLUGIN_ACTION_GET_UPDATES_HISTORICAL:
        case GS_PLUGIN_ACTION_GET_DISTRO_UPDATES:
        case GS_PLUGIN_ACTION_GET_SOURCES:
-       case GS_PLUGIN_ACTION_GET_INSTALLED:
        case GS_PLUGIN_ACTION_GET_POPULAR:
        case GS_PLUGIN_ACTION_GET_FEATURED:
                {
@@ -961,42 +960,6 @@ gs_plugin_loader_get_app_str (GsApp *app)
        return "<invalid>";
 }
 
-static gboolean
-gs_plugin_loader_app_is_valid_installed (GsApp *app, gpointer user_data)
-{
-       /* even without AppData, show things in progress */
-       switch (gs_app_get_state (app)) {
-       case GS_APP_STATE_INSTALLING:
-       case GS_APP_STATE_REMOVING:
-               return TRUE;
-               break;
-       default:
-               break;
-       }
-
-       switch (gs_app_get_kind (app)) {
-       case AS_COMPONENT_KIND_OPERATING_SYSTEM:
-       case AS_COMPONENT_KIND_CODEC:
-       case AS_COMPONENT_KIND_FONT:
-               g_debug ("app invalid as %s: %s",
-                        as_component_kind_to_string (gs_app_get_kind (app)),
-                        gs_plugin_loader_get_app_str (app));
-               return FALSE;
-               break;
-       default:
-               break;
-       }
-
-       /* sanity check */
-       if (!gs_app_is_installed (app)) {
-               g_autofree gchar *tmp = gs_app_to_string (app);
-               g_warning ("ignoring non-installed app %s", tmp);
-               return FALSE;
-       }
-
-       return TRUE;
-}
-
 gboolean
 gs_plugin_loader_app_is_valid (GsApp               *app,
                                GsPluginRefineFlags  refine_flags)
@@ -3220,7 +3183,6 @@ gs_plugin_loader_process_thread_cb (GTask *task,
 
        /* some functions are really required for proper operation */
        switch (action) {
-       case GS_PLUGIN_ACTION_GET_INSTALLED:
        case GS_PLUGIN_ACTION_GET_UPDATES:
        case GS_PLUGIN_ACTION_INSTALL:
        case GS_PLUGIN_ACTION_DOWNLOAD:
@@ -3424,10 +3386,6 @@ gs_plugin_loader_process_thread_cb (GTask *task,
                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_INSTALLED:
-               gs_app_list_filter (list, gs_plugin_loader_app_is_valid_filter, helper);
-               gs_app_list_filter (list, gs_plugin_loader_app_is_valid_installed, helper);
-               break;
        case GS_PLUGIN_ACTION_GET_FEATURED:
                if (g_getenv ("GNOME_SOFTWARE_FEATURED") != NULL) {
                        gs_app_list_filter (list, gs_plugin_loader_featured_debug, NULL);
@@ -3915,7 +3873,6 @@ gs_plugin_loader_job_process_async (GsPluginLoader *plugin_loader,
        case GS_PLUGIN_ACTION_GET_ALTERNATES:
        case GS_PLUGIN_ACTION_GET_CATEGORY_APPS:
        case GS_PLUGIN_ACTION_GET_FEATURED:
-       case GS_PLUGIN_ACTION_GET_INSTALLED:
        case GS_PLUGIN_ACTION_GET_POPULAR:
        case GS_PLUGIN_ACTION_GET_RECENT:
        case GS_PLUGIN_ACTION_SEARCH:
diff --git a/lib/gs-plugin-types.h b/lib/gs-plugin-types.h
index 59ce63f60..9b1f31c93 100644
--- a/lib/gs-plugin-types.h
+++ b/lib/gs-plugin-types.h
@@ -202,7 +202,6 @@ typedef enum {
  * @GS_PLUGIN_ACTION_GET_UPDATES:              Get the list of updates
  * @GS_PLUGIN_ACTION_GET_DISTRO_UPDATES:       Get the list of distro updates
  * @GS_PLUGIN_ACTION_GET_SOURCES:              Get the list of sources
- * @GS_PLUGIN_ACTION_GET_INSTALLED:            Get the list of installed applications
  * @GS_PLUGIN_ACTION_GET_POPULAR:              Get the list of popular applications
  * @GS_PLUGIN_ACTION_GET_FEATURED:             Get the list of featured applications
  * @GS_PLUGIN_ACTION_SEARCH:                   Get the search results for a query
@@ -237,7 +236,6 @@ typedef enum {
        GS_PLUGIN_ACTION_GET_UPDATES,
        GS_PLUGIN_ACTION_GET_DISTRO_UPDATES,
        GS_PLUGIN_ACTION_GET_SOURCES,
-       GS_PLUGIN_ACTION_GET_INSTALLED,
        GS_PLUGIN_ACTION_GET_POPULAR,
        GS_PLUGIN_ACTION_GET_FEATURED,
        GS_PLUGIN_ACTION_SEARCH,
diff --git a/lib/gs-plugin-vfuncs.h b/lib/gs-plugin-vfuncs.h
index ff045738d..2dd294e31 100644
--- a/lib/gs-plugin-vfuncs.h
+++ b/lib/gs-plugin-vfuncs.h
@@ -146,24 +146,6 @@ gboolean    gs_plugin_add_alternates               (GsPlugin       *plugin,
                                                         GCancellable   *cancellable,
                                                         GError         **error);
 
-/**
- * gs_plugin_add_installed:
- * @plugin: a #GsPlugin
- * @list: a #GsAppList
- * @cancellable: a #GCancellable, or %NULL
- * @error: a #GError, or %NULL
- *
- * Get the list of installed applications.
- *
- * Plugins are expected to add new apps using gs_app_list_add().
- *
- * Returns: %TRUE for success or if not relevant
- **/
-gboolean        gs_plugin_add_installed                (GsPlugin       *plugin,
-                                                        GsAppList      *list,
-                                                        GCancellable   *cancellable,
-                                                        GError         **error);
-
 /**
  * gs_plugin_add_updates:
  * @plugin: a #GsPlugin
diff --git a/lib/gs-plugin.c b/lib/gs-plugin.c
index c4cdf1168..27663aed3 100644
--- a/lib/gs-plugin.c
+++ b/lib/gs-plugin.c
@@ -1689,8 +1689,6 @@ gs_plugin_action_to_function_name (GsPluginAction action)
                return "gs_plugin_add_distro_upgrades";
        if (action == GS_PLUGIN_ACTION_GET_SOURCES)
                return "gs_plugin_add_sources";
-       if (action == GS_PLUGIN_ACTION_GET_INSTALLED)
-               return "gs_plugin_add_installed";
        if (action == GS_PLUGIN_ACTION_GET_FEATURED)
                return "gs_plugin_add_featured";
        if (action == GS_PLUGIN_ACTION_GET_UPDATES_HISTORICAL)
@@ -1761,8 +1759,6 @@ gs_plugin_action_to_string (GsPluginAction action)
                return "get-distro-updates";
        if (action == GS_PLUGIN_ACTION_GET_SOURCES)
                return "get-sources";
-       if (action == GS_PLUGIN_ACTION_GET_INSTALLED)
-               return "get-installed";
        if (action == GS_PLUGIN_ACTION_GET_POPULAR)
                return "get-popular";
        if (action == GS_PLUGIN_ACTION_GET_FEATURED)
@@ -1837,8 +1833,6 @@ gs_plugin_action_from_string (const gchar *action)
                return GS_PLUGIN_ACTION_GET_DISTRO_UPDATES;
        if (g_strcmp0 (action, "get-sources") == 0)
                return GS_PLUGIN_ACTION_GET_SOURCES;
-       if (g_strcmp0 (action, "get-installed") == 0)
-               return GS_PLUGIN_ACTION_GET_INSTALLED;
        if (g_strcmp0 (action, "get-popular") == 0)
                return GS_PLUGIN_ACTION_GET_POPULAR;
        if (g_strcmp0 (action, "get-featured") == 0)


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