[gnome-software] Make GsCategory constructor more convenient



commit 47ea525f10d6053a5d7acf02740e9559398dd9b8
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Aug 29 14:25:55 2013 -0400

    Make GsCategory constructor more convenient

 src/gs-category.c |    3 ++-
 src/gs-category.h |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-category.c b/src/gs-category.c
index 1e7b021..18a4270 100644
--- a/src/gs-category.c
+++ b/src/gs-category.c
@@ -108,11 +108,12 @@ gs_category_finalize (GObject *object)
 }
 
 GsCategory *
-gs_category_new (GsCategory *parent, const gchar *id)
+gs_category_new (GsCategory *parent, const gchar *id, const gchar *name)
 {
        GsCategory *category;
        category = g_object_new (GS_TYPE_CATEGORY, NULL);
         category->priv->parent = parent;
         category->priv->id = g_strdup (id);
+        category->priv->name = g_strdup (name);
        return GS_CATEGORY (category);
 }
diff --git a/src/gs-category.h b/src/gs-category.h
index b12f711..55cc047 100644
--- a/src/gs-category.h
+++ b/src/gs-category.h
@@ -49,7 +49,8 @@ typedef struct
 GType           gs_category_get_type           (void);
 
 GsCategory     *gs_category_new                (GsCategory             *parent,
-                                                 const gchar           *id);
+                                                 const gchar           *id,
+                                                 const gchar            *name);
 const gchar    *gs_category_get_id             (GsCategory             *category);
 GsCategory      *gs_category_get_parent         (GsCategory             *category);
 const gchar    *gs_category_get_name           (GsCategory             *category);


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