[gnome-software] Do not show system applications in the installed view
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Do not show system applications in the installed view
- Date: Tue, 13 Aug 2013 10:44:15 +0000 (UTC)
commit 6b262798bab562a59714563e655e24f9e9fbe812
Author: Richard Hughes <richard hughsie com>
Date: Tue Aug 13 10:43:43 2013 +0100
Do not show system applications in the installed view
src/gs-plugin-loader.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index f468e0b..6fe4b1f 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -217,6 +217,28 @@ gs_plugin_loader_remove_invalid (GList *list)
return list;
}
+/**
+ * gs_plugin_loader_remove_system:
+ **/
+static GList *
+gs_plugin_loader_remove_system (GList *list)
+{
+ GList *l;
+ GsApp *app;
+
+ for (l = list; l != NULL;) {
+ app = GS_APP (l->data);
+ if (gs_app_get_kind (app) != GS_APP_KIND_SYSTEM) {
+ l = l->next;
+ continue;
+ }
+ g_debug ("removing package %s", gs_app_get_id (app));
+ g_object_unref (app);
+ l = list = g_list_delete_link (list, l);
+ }
+ return list;
+}
+
/******************************************************************************/
/* async state */
@@ -449,6 +471,7 @@ cd_plugin_loader_get_installed_thread_cb (GSimpleAsyncResult *res,
g_error_free (error);
goto out;
}
+ state->list = gs_plugin_loader_remove_system (state->list);
state->list = gs_plugin_loader_remove_invalid (state->list);
if (state->list == NULL) {
g_set_error_literal (&error,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]