[gnome-software] overview: Show popular games as a separate section in the landing page
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] overview: Show popular games as a separate section in the landing page
- Date: Mon, 11 Aug 2014 11:33:04 +0000 (UTC)
commit 396766c2ce7808dab04e90edd748d5eeeaa31185
Author: Kalev Lember <kalevlember gmail com>
Date: Mon Aug 4 13:03:57 2014 +0200
overview: Show popular games as a separate section in the landing page
https://bugzilla.gnome.org/show_bug.cgi?id=727998
configure.ac | 2 +-
data/modulesets/gnome.xml | 11 +++-
src/gs-cmd.c | 1 +
src/gs-plugin-loader-sync.c | 2 +
src/gs-plugin-loader-sync.h | 1 +
src/gs-plugin-loader.c | 130 ++++++++++++++++++++++++++++++++++++-
src/gs-plugin-loader.h | 1 +
src/gs-plugin.h | 6 ++
src/gs-self-test.c | 2 +-
src/gs-shell-overview.c | 57 ++++++++++++++++-
src/gs-shell-overview.ui | 46 +++++++++++++-
src/plugins/gs-moduleset.c | 12 +++-
src/plugins/gs-moduleset.h | 3 +-
src/plugins/gs-plugin-appstream.c | 5 ++
src/plugins/gs-plugin-dummy.c | 1 +
src/plugins/gs-plugin-moduleset.c | 10 ++-
src/plugins/gs-self-test.c | 6 +-
17 files changed, 282 insertions(+), 14 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index e4bfdde..483a047 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,7 +89,7 @@ AM_CONDITIONAL(ENABLE_DOGTAIL, test "$enable_dogtail" != no)
# this refers to the gnome-software plugin API version
# this is not in any way related to a package or soname version
-GS_PLUGIN_API_VERSION=4
+GS_PLUGIN_API_VERSION=5
AC_SUBST(GS_PLUGIN_API_VERSION)
AC_DEFINE_UNQUOTED([GS_PLUGIN_API_VERSION], "$GS_PLUGIN_API_VERSION", [the plugin API version])
diff --git a/data/modulesets/gnome.xml b/data/modulesets/gnome.xml
index c51679b..0c9c340 100644
--- a/data/modulesets/gnome.xml
+++ b/data/modulesets/gnome.xml
@@ -18,10 +18,19 @@
<module type="application">sol.desktop</module>
<module type="application">shutter.desktop</module>
<module type="application">gnucash.desktop</module>
- <module type="application">iagno.desktop</module>
<module type="application">mozilla-thunderbird.desktop</module>
<module type="application">geary.desktop</module>
<module type="application">pdfmod.desktop</module>
+ <module type="application" category="Game">gnome-chess.desktop</module>
+ <module type="application" category="Game">gnome-mahjongg.desktop</module>
+ <module type="application" category="Game">gnome-mines.desktop</module>
+ <module type="application" category="Game">gnome-sudoku.desktop</module>
+ <module type="application" category="Game">gnome-tetravex.desktop</module>
+ <module type="application" category="Game">iagno.desktop</module>
+ <module type="application" category="Game">lightsoff.desktop</module>
+ <module type="application" category="Game">quadrapassel.desktop</module>
+ <module type="application" category="Game">sol.desktop</module>
+ <module type="application" category="Game">swell-foop.desktop</module>
</moduleset>
<moduleset name="system">
diff --git a/src/gs-cmd.c b/src/gs-cmd.c
index e9288fd..6e27af8 100644
--- a/src/gs-cmd.c
+++ b/src/gs-cmd.c
@@ -330,6 +330,7 @@ main (int argc, char **argv)
list = gs_plugin_loader_get_popular (plugin_loader,
refine_flags,
NULL,
+ NULL,
&error);
if (list == NULL) {
ret = FALSE;
diff --git a/src/gs-plugin-loader-sync.c b/src/gs-plugin-loader-sync.c
index 462a2ba..44c8df1 100644
--- a/src/gs-plugin-loader-sync.c
+++ b/src/gs-plugin-loader-sync.c
@@ -254,6 +254,7 @@ gs_plugin_loader_get_popular_finish_sync (GsPluginLoader *plugin_loader,
GList *
gs_plugin_loader_get_popular (GsPluginLoader *plugin_loader,
GsPluginRefineFlags flags,
+ const gchar *category,
GCancellable *cancellable,
GError **error)
{
@@ -269,6 +270,7 @@ gs_plugin_loader_get_popular (GsPluginLoader *plugin_loader,
/* run async method */
gs_plugin_loader_get_popular_async (plugin_loader,
flags,
+ category,
cancellable,
(GAsyncReadyCallback) gs_plugin_loader_get_popular_finish_sync,
&helper);
diff --git a/src/gs-plugin-loader-sync.h b/src/gs-plugin-loader-sync.h
index c600545..ae9ce79 100644
--- a/src/gs-plugin-loader-sync.h
+++ b/src/gs-plugin-loader-sync.h
@@ -47,6 +47,7 @@ GList *gs_plugin_loader_get_sources (GsPluginLoader *plugin_loader,
GError **error);
GList *gs_plugin_loader_get_popular (GsPluginLoader *plugin_loader,
GsPluginRefineFlags flags,
+ const gchar *category,
GCancellable *cancellable,
GError **error);
GList *gs_plugin_loader_get_featured (GsPluginLoader *plugin_loader,
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 3f32521..9338c4f 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -441,6 +441,129 @@ out:
}
/**
+ * gs_plugin_loader_run_popular_plugin:
+ **/
+static gboolean
+gs_plugin_loader_run_popular_plugin (GsPluginLoader *plugin_loader,
+ GsPlugin *plugin,
+ const gchar *function_name,
+ GList **list,
+ const gchar *category,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GsPluginPopularFunc plugin_func = NULL;
+ gboolean exists;
+ gboolean ret = TRUE;
+ gchar *profile_id = NULL;
+
+ /* get symbol */
+ exists = g_module_symbol (plugin->module,
+ function_name,
+ (gpointer *) &plugin_func);
+ if (!exists)
+ goto out;
+
+ /* run function */
+ profile_id = g_strdup_printf ("GsPlugin::%s(%s)",
+ plugin->name, function_name);
+ gs_profile_start (plugin_loader->priv->profile, profile_id);
+ g_assert (error == NULL || *error == NULL);
+ ret = plugin_func (plugin, list, category, cancellable, error);
+ if (!ret)
+ goto out;
+out:
+ if (profile_id != NULL) {
+ gs_plugin_status_update (plugin, NULL, GS_PLUGIN_STATUS_FINISHED);
+ gs_profile_stop (plugin_loader->priv->profile, profile_id);
+ }
+ g_free (profile_id);
+ return ret;
+}
+
+/**
+ * gs_plugin_loader_run_popular:
+ **/
+static GList *
+gs_plugin_loader_run_popular (GsPluginLoader *plugin_loader,
+ const gchar *function_name,
+ GsPluginRefineFlags flags,
+ const gchar *category,
+ GCancellable *cancellable,
+ GError **error)
+{
+ gboolean ret = TRUE;
+ gchar *profile_id_parent;
+ GList *list = NULL;
+ GsPlugin *plugin;
+ guint i;
+
+ g_return_val_if_fail (GS_IS_PLUGIN_LOADER (plugin_loader), NULL);
+ g_return_val_if_fail (function_name != NULL, NULL);
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+ g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL);
+
+ /* profile */
+ profile_id_parent = g_strdup_printf ("GsPlugin::*(%s)",
+ function_name);
+ gs_profile_start (plugin_loader->priv->profile, profile_id_parent);
+
+ /* run each plugin */
+ for (i = 0; i < plugin_loader->priv->plugins->len; i++) {
+ plugin = g_ptr_array_index (plugin_loader->priv->plugins, i);
+ if (!plugin->enabled)
+ continue;
+ ret = g_cancellable_set_error_if_cancelled (cancellable, error);
+ if (ret) {
+ ret = FALSE;
+ goto out;
+ }
+ ret = gs_plugin_loader_run_popular_plugin (plugin_loader,
+ plugin,
+ function_name,
+ &list,
+ category,
+ cancellable,
+ error);
+ if (!ret)
+ goto out;
+ }
+
+ /* dedupe applications we already know about */
+ gs_plugin_loader_list_dedupe (plugin_loader, list);
+
+ /* run refine() on each one */
+ ret = gs_plugin_loader_run_refine (plugin_loader,
+ function_name,
+ &list,
+ flags,
+ cancellable,
+ error);
+ if (!ret)
+ goto out;
+
+ /* filter package list */
+ gs_plugin_list_filter_duplicates (&list);
+
+ /* no results */
+ if (list == NULL) {
+ g_set_error (error,
+ GS_PLUGIN_LOADER_ERROR,
+ GS_PLUGIN_LOADER_ERROR_NO_RESULTS,
+ "no results to show");
+ goto out;
+ }
+out:
+ gs_profile_stop (plugin_loader->priv->profile, profile_id_parent);
+ g_free (profile_id_parent);
+ if (!ret) {
+ gs_plugin_list_free (list);
+ list = NULL;
+ }
+ return list;
+}
+
+/**
* gs_plugin_loader_get_app_str:
**/
static const gchar *
@@ -695,6 +818,7 @@ typedef struct {
GsPluginRefineFlags flags;
gchar *value;
gchar *filename;
+ gchar *popular_category;
guint cache_age;
GsCategory *category;
GsApp *app;
@@ -713,6 +837,7 @@ gs_plugin_loader_free_async_state (GsPluginLoaderAsyncState *state)
g_object_unref (state->app);
g_free (state->filename);
+ g_free (state->popular_category);
g_free (state->value);
gs_plugin_list_free (state->list);
g_slice_free (GsPluginLoaderAsyncState, state);
@@ -1125,9 +1250,10 @@ gs_plugin_loader_get_popular_thread_cb (GTask *task,
GsPluginLoaderAsyncState *state = (GsPluginLoaderAsyncState *) task_data;
/* do things that would block */
- state->list = gs_plugin_loader_run_results (plugin_loader,
+ state->list = gs_plugin_loader_run_popular (plugin_loader,
"gs_plugin_add_popular",
state->flags,
+ state->popular_category,
cancellable,
&error);
if (state->list == NULL) {
@@ -1161,6 +1287,7 @@ out:
void
gs_plugin_loader_get_popular_async (GsPluginLoader *plugin_loader,
GsPluginRefineFlags flags,
+ const gchar *category,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -1174,6 +1301,7 @@ gs_plugin_loader_get_popular_async (GsPluginLoader *plugin_loader,
/* save state */
state = g_slice_new0 (GsPluginLoaderAsyncState);
state->flags = flags;
+ state->popular_category = g_strdup (category);
/* run in a thread */
task = g_task_new (plugin_loader, cancellable, callback, user_data);
diff --git a/src/gs-plugin-loader.h b/src/gs-plugin-loader.h
index 2875a18..b8d219e 100644
--- a/src/gs-plugin-loader.h
+++ b/src/gs-plugin-loader.h
@@ -104,6 +104,7 @@ GList *gs_plugin_loader_get_sources_finish (GsPluginLoader
*plugin_loader,
GError **error);
void gs_plugin_loader_get_popular_async (GsPluginLoader *plugin_loader,
GsPluginRefineFlags flags,
+ const gchar *category,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
diff --git a/src/gs-plugin.h b/src/gs-plugin.h
index bca2b9b..a73e883 100644
--- a/src/gs-plugin.h
+++ b/src/gs-plugin.h
@@ -122,6 +122,11 @@ typedef gboolean (*GsPluginCategoryFunc) (GsPlugin *plugin,
GList **list,
GCancellable *cancellable,
GError **error);
+typedef gboolean (*GsPluginPopularFunc) (GsPlugin *plugin,
+ GList **list,
+ const gchar *category,
+ GCancellable *cancellable,
+ GError **error);
typedef gboolean (*GsPluginResultsFunc) (GsPlugin *plugin,
GList **list,
GCancellable *cancellable,
@@ -201,6 +206,7 @@ gboolean gs_plugin_add_category_apps (GsPlugin *plugin,
GError **error);
gboolean gs_plugin_add_popular (GsPlugin *plugin,
GList **list,
+ const gchar *category,
GCancellable *cancellable,
GError **error);
gboolean gs_plugin_add_featured (GsPlugin *plugin,
diff --git a/src/gs-self-test.c b/src/gs-self-test.c
index c4ed6a9..544e479 100644
--- a/src/gs-self-test.c
+++ b/src/gs-self-test.c
@@ -402,7 +402,7 @@ gs_plugin_loader_func (void)
ret = gs_plugin_loader_set_enabled (loader, "notgoingtoexist", TRUE);
g_assert (!ret);
- list = gs_plugin_loader_get_popular (loader, GS_PLUGIN_REFINE_FLAGS_DEFAULT, NULL, &error);
+ list = gs_plugin_loader_get_popular (loader, GS_PLUGIN_REFINE_FLAGS_DEFAULT, NULL, NULL, &error);
g_assert_no_error (error);
g_assert (list != NULL);
g_assert_cmpint (_status_changed_cnt, ==, 1);
diff --git a/src/gs-shell-overview.c b/src/gs-shell-overview.c
index 422f693..f139e51 100644
--- a/src/gs-shell-overview.c
+++ b/src/gs-shell-overview.c
@@ -45,10 +45,12 @@ struct GsShellOverviewPrivate
GtkWidget *bin_featured;
GtkWidget *box_overview;
GtkWidget *box_popular;
+ GtkWidget *box_popular_games;
GtkWidget *category_heading;
GtkWidget *featured_heading;
GtkWidget *grid_categories;
GtkWidget *popular_heading;
+ GtkWidget *popular_games_heading;
GtkWidget *scrolledwindow_overview;
GtkWidget *stack_overview;
};
@@ -128,6 +130,49 @@ out:
}
static void
+gs_shell_overview_get_popular_games_cb (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ GsShellOverview *shell = GS_SHELL_OVERVIEW (user_data);
+ GsShellOverviewPrivate *priv = shell->priv;
+ GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source_object);
+ GError *error = NULL;
+ GList *l;
+ GList *list;
+ GsApp *app;
+ gint i;
+ GtkWidget *tile;
+
+ /* get popular games */
+ list = gs_plugin_loader_get_popular_finish (plugin_loader, res, &error);
+ gtk_widget_set_visible (priv->popular_games_heading, list != NULL);
+ if (list == NULL) {
+ g_warning ("failed to get popular games: %s", error->message);
+ g_error_free (error);
+ goto out;
+ }
+
+ gs_container_remove_all (GTK_CONTAINER (priv->box_popular_games));
+
+ for (l = list, i = 0; l != NULL && i < 6; l = l->next, i++) {
+ app = GS_APP (l->data);
+ tile = gs_popular_tile_new (app);
+ g_signal_connect (tile, "clicked",
+ G_CALLBACK (popular_tile_clicked), shell);
+ gtk_box_pack_start (GTK_BOX (priv->box_popular_games), tile, TRUE, TRUE, 0);
+ }
+
+ priv->empty = FALSE;
+
+out:
+ gs_plugin_list_free (list);
+ priv->refresh_count--;
+ if (priv->refresh_count == 0)
+ g_signal_emit (shell, signals[SIGNAL_REFRESHED], 0);
+}
+
+static void
feature_tile_clicked (GsFeatureTile *tile, gpointer data)
{
GsShellOverview *shell = GS_SHELL_OVERVIEW (data);
@@ -270,7 +315,7 @@ gs_shell_overview_refresh (GsShellOverview *shell, gboolean scroll_up)
return;
priv->empty = TRUE;
- priv->refresh_count = 3;
+ priv->refresh_count = 4;
gs_plugin_loader_get_featured_async (priv->plugin_loader,
GS_PLUGIN_REFINE_FLAGS_DEFAULT,
@@ -280,10 +325,18 @@ gs_shell_overview_refresh (GsShellOverview *shell, gboolean scroll_up)
gs_plugin_loader_get_popular_async (priv->plugin_loader,
GS_PLUGIN_REFINE_FLAGS_DEFAULT,
+ NULL,
priv->cancellable,
gs_shell_overview_get_popular_cb,
shell);
+ gs_plugin_loader_get_popular_async (priv->plugin_loader,
+ GS_PLUGIN_REFINE_FLAGS_DEFAULT,
+ "Game",
+ priv->cancellable,
+ gs_shell_overview_get_popular_games_cb,
+ shell);
+
gs_plugin_loader_get_categories_async (priv->plugin_loader,
GS_PLUGIN_REFINE_FLAGS_DEFAULT,
priv->cancellable,
@@ -381,10 +434,12 @@ gs_shell_overview_class_init (GsShellOverviewClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, bin_featured);
gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, box_overview);
gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, box_popular);
+ gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, box_popular_games);
gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, category_heading);
gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, featured_heading);
gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, grid_categories);
gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, popular_heading);
+ gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, popular_games_heading);
gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, scrolledwindow_overview);
gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, stack_overview);
}
diff --git a/src/gs-shell-overview.ui b/src/gs-shell-overview.ui
index f09739c..bbde529 100644
--- a/src/gs-shell-overview.ui
+++ b/src/gs-shell-overview.ui
@@ -113,6 +113,48 @@
</packing>
</child>
<child>
+ <object class="GtkLabel" id="popular_games_heading">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="Translators: This is a heading
for games which have been featured ('recommended') by the distribution.">Recommended Games</property>
+ <property name="margin-top">24</property>
+ <property name="margin-bottom">12</property>
+ <property name="margin-start">24</property>
+ <property name="margin-end">24</property>
+ <accessibility>
+ <relation target="box_popular_games" type="label-for"/>
+ </accessibility>
+ <style>
+ <class name="index-title-alignment-software"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box_popular_games">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_start">12</property>
+ <property name="margin_end">12</property>
+ <property name="spacing">12</property>
+ <property name="homogeneous">True</property>
+ <property name="valign">start</property>
+ <accessibility>
+ <relation target="popular_games_heading" type="labelled-by"/>
+ </accessibility>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkLabel" id="category_heading">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -132,7 +174,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">4</property>
+ <property name="position">6</property>
</packing>
</child>
<child>
@@ -153,7 +195,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">5</property>
+ <property name="position">7</property>
</packing>
</child>
</object>
diff --git a/src/plugins/gs-moduleset.c b/src/plugins/gs-moduleset.c
index 3af855e..26701d8 100644
--- a/src/plugins/gs-moduleset.c
+++ b/src/plugins/gs-moduleset.c
@@ -29,6 +29,7 @@
typedef struct {
GsModulesetModuleKind module_kind;
gchar *name;
+ gchar *category;
gchar *id;
} GsModulesetEntry;
@@ -54,7 +55,8 @@ G_DEFINE_TYPE_WITH_PRIVATE (GsModuleset, gs_moduleset, G_TYPE_OBJECT)
gchar **
gs_moduleset_get_modules (GsModuleset *moduleset,
GsModulesetModuleKind module_kind,
- const gchar *name)
+ const gchar *name,
+ const gchar *category)
{
GsModulesetPrivate *priv = gs_moduleset_get_instance_private (moduleset);
GsModulesetEntry *entry;
@@ -72,6 +74,8 @@ gs_moduleset_get_modules (GsModuleset *moduleset,
continue;
if (g_strcmp0 (entry->name, name) != 0)
continue;
+ if (g_strcmp0 (entry->category, category) != 0)
+ continue;
data[idx++] = g_strdup (entry->id);
}
@@ -119,6 +123,7 @@ gs_moduleset_parser_start_element (GMarkupParseContext *context,
GsModulesetPrivate *priv = gs_moduleset_get_instance_private (moduleset);
GsModulesetParserSection section_new;
GsModulesetModuleKind kind = GS_MODULESET_MODULE_KIND_UNKNOWN;
+ const gchar *category = NULL;
guint i;
section_new = gs_moduleset_section_from_string (element_name);
@@ -148,8 +153,12 @@ gs_moduleset_parser_start_element (GMarkupParseContext *context,
if (g_strcmp0 (attribute_names[i], "type") == 0) {
kind = gs_moduleset_module_kind_from_string (attribute_values[i]);
}
+ if (g_strcmp0 (attribute_names[i], "category") == 0) {
+ category = attribute_values[i];
+ }
}
priv->entry_tmp->module_kind = kind;
+ priv->entry_tmp->category = g_strdup (category);
return;
}
g_warning ("moduleset->%s", element_name);
@@ -284,6 +293,7 @@ gs_moduleset_entry_free (GsModulesetEntry *entry)
{
g_free (entry->id);
g_free (entry->name);
+ g_free (entry->category);
g_slice_free (GsModulesetEntry, entry);
}
diff --git a/src/plugins/gs-moduleset.h b/src/plugins/gs-moduleset.h
index 5860f8b..3473cb3 100644
--- a/src/plugins/gs-moduleset.h
+++ b/src/plugins/gs-moduleset.h
@@ -51,7 +51,8 @@ GsModuleset *gs_moduleset_new (void);
gchar **gs_moduleset_get_modules (GsModuleset *moduleset,
GsModulesetModuleKind module_kind,
- const gchar *name);
+ const gchar *name,
+ const gchar *category);
gboolean gs_moduleset_parse_filename (GsModuleset *moduleset,
const gchar *filename,
GError **error);
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index f7b1ce9..6f79437 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -1169,6 +1169,7 @@ out:
gboolean
gs_plugin_add_popular (GsPlugin *plugin,
GList **list,
+ const gchar *category,
GCancellable *cancellable,
GError **error)
{
@@ -1183,6 +1184,10 @@ gs_plugin_add_popular (GsPlugin *plugin,
}
gs_profile_start (plugin->profile, "appstream::add_popular");
+ /* FIXME: support different popular kinds */
+ if (category != NULL)
+ goto out;
+
/* use category heuristic */
ret = gs_plugin_add_popular_by_cat (plugin, list, cancellable, error);
if (!ret)
diff --git a/src/plugins/gs-plugin-dummy.c b/src/plugins/gs-plugin-dummy.c
index 4814a87..e24db15 100644
--- a/src/plugins/gs-plugin-dummy.c
+++ b/src/plugins/gs-plugin-dummy.c
@@ -146,6 +146,7 @@ gs_plugin_add_installed (GsPlugin *plugin,
gboolean
gs_plugin_add_popular (GsPlugin *plugin,
GList **list,
+ const gchar *category,
GCancellable *cancellable,
GError **error)
{
diff --git a/src/plugins/gs-plugin-moduleset.c b/src/plugins/gs-plugin-moduleset.c
index 13c69d6..284d1f8 100644
--- a/src/plugins/gs-plugin-moduleset.c
+++ b/src/plugins/gs-plugin-moduleset.c
@@ -101,6 +101,7 @@ out:
gboolean
gs_plugin_add_popular (GsPlugin *plugin,
GList **list,
+ const gchar *category,
GCancellable *cancellable,
GError **error)
{
@@ -122,7 +123,8 @@ gs_plugin_add_popular (GsPlugin *plugin,
} else {
apps = gs_moduleset_get_modules (plugin->priv->moduleset,
GS_MODULESET_MODULE_KIND_APPLICATION,
- "popular");
+ "popular",
+ category);
}
/* just add all */
@@ -165,7 +167,8 @@ gs_plugin_refine (GsPlugin *plugin,
/* just mark each one as core */
apps = gs_moduleset_get_modules (plugin->priv->moduleset,
GS_MODULESET_MODULE_KIND_APPLICATION,
- "system");
+ "system",
+ NULL);
for (l = *list; l != NULL; l = l->next) {
app = GS_APP (l->data);
for (i = 0; apps[i] != NULL; i++) {
@@ -179,7 +182,8 @@ gs_plugin_refine (GsPlugin *plugin,
/* just mark each one as core */
pkgs = gs_moduleset_get_modules (plugin->priv->moduleset,
GS_MODULESET_MODULE_KIND_PACKAGE,
- "core");
+ "core",
+ NULL);
for (l = *list; l != NULL; l = l->next) {
app = GS_APP (l->data);
for (i = 0; pkgs[i] != NULL; i++) {
diff --git a/src/plugins/gs-self-test.c b/src/plugins/gs-self-test.c
index 46b76ba..a863788 100644
--- a/src/plugins/gs-self-test.c
+++ b/src/plugins/gs-self-test.c
@@ -47,7 +47,8 @@ moduleset_func (void)
data = gs_moduleset_get_modules (ms,
GS_MODULESET_MODULE_KIND_PACKAGE,
- "gnome3");
+ "gnome3",
+ NULL);
g_assert (data != NULL);
g_assert_cmpint (g_strv_length (data), ==, 1);
g_assert_cmpstr (data[0], ==, "kernel");
@@ -55,7 +56,8 @@ moduleset_func (void)
data = gs_moduleset_get_modules (ms,
GS_MODULESET_MODULE_KIND_APPLICATION,
- "gnome3");
+ "gnome3",
+ NULL);
g_assert (data != NULL);
g_assert_cmpint (g_strv_length (data), ==, 1);
g_assert_cmpstr (data[0], ==, "gnome-shell.desktop");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]