[gnome-software: 7/25] core: Drop add_category_apps() implementation from desktop-categories




commit 840c7d469023d7e6c685ae04c1b0f2f06682bf36
Author: Philip Withnall <pwithnall endlessos org>
Date:   Mon Feb 1 22:52:47 2021 +0000

    core: Drop add_category_apps() implementation from desktop-categories
    
    It was only needed to handle the case where some other code constructed
    a `GsCategory` from scratch itself, and the previous two commits have
    removed both of those call sites, so this code is now redundant.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 plugins/core/gs-plugin-desktop-categories.c | 41 -----------------------------
 1 file changed, 41 deletions(-)
---
diff --git a/plugins/core/gs-plugin-desktop-categories.c b/plugins/core/gs-plugin-desktop-categories.c
index 289575bce..554f14606 100644
--- a/plugins/core/gs-plugin-desktop-categories.c
+++ b/plugins/core/gs-plugin-desktop-categories.c
@@ -24,44 +24,3 @@ gs_plugin_initialize (GsPlugin *plugin)
        /* need categories */
        gs_plugin_add_rule (plugin, GS_PLUGIN_RULE_RUN_BEFORE, "appstream");
 }
-
-/* most of this time this won't be required, unless the user creates a
- * GsCategory manually and uses it to get results, for instance in the
- * overview page or `gnome-software-cmd get-category-apps games/featured` */
-gboolean
-gs_plugin_add_category_apps (GsPlugin *plugin,
-                            GsCategory *category,
-                            GsAppList *list,
-                            GCancellable *cancellable,
-                            GError **error)
-{
-       GPtrArray *desktop_groups;
-       GsCategory *parent;
-       const GsDesktopData *msdata;
-       guint i, j, k;
-
-       /* already set */
-       desktop_groups = gs_category_get_desktop_groups (category);
-       if (desktop_groups->len > 0)
-               return TRUE;
-
-       /* not valid */
-       parent = gs_category_get_parent (category);
-       if (parent == NULL)
-               return TRUE;
-
-       /* find desktop_groups for a parent::child category */
-       msdata = gs_desktop_get_data ();
-       for (i = 0; msdata[i].id != NULL; i++) {
-               if (g_strcmp0 (gs_category_get_id (parent), msdata[i].id) != 0)
-                       continue;
-               for (j = 0; msdata[i].mapping[j].id != NULL; j++) {
-                       const GsDesktopMap *map = &msdata[i].mapping[j];
-                       if (g_strcmp0 (gs_category_get_id (category), map->id) != 0)
-                               continue;
-                       for (k = 0; map->fdo_cats[k] != NULL; k++)
-                               gs_category_add_desktop_group (category, map->fdo_cats[k]);
-               }
-       }
-       return TRUE;
-}


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