[gnome-software] trivial: Never allow adding duplicate categories to apps



commit c37c827b440017a324e8736e6ee17c40643e67c7
Author: Richard Hughes <richard hughsie com>
Date:   Sun Jun 12 16:17:56 2016 +0100

    trivial: Never allow adding duplicate categories to apps

 src/gs-app.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-app.c b/src/gs-app.c
index e2ba06f..1baf03c 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -2326,6 +2326,8 @@ gs_app_add_category (GsApp *app, const gchar *category)
 {
        g_return_if_fail (GS_IS_APP (app));
        g_return_if_fail (category != NULL);
+       if (gs_app_has_category (app, category))
+               return;
        g_ptr_array_add (app->categories, g_strdup (category));
 }
 


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