[gnome-software] Use G_DEFINE_TYPE_WITH_PRIVATE for GsCategory
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Use G_DEFINE_TYPE_WITH_PRIVATE for GsCategory
- Date: Thu, 27 Mar 2014 10:18:39 +0000 (UTC)
commit 9f84d844f8ae0a486720eeeb596e2dd41876336f
Author: Kalev Lember <kalevlember gmail com>
Date: Thu Mar 27 10:44:10 2014 +0100
Use G_DEFINE_TYPE_WITH_PRIVATE for GsCategory
src/gs-category.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/src/gs-category.c b/src/gs-category.c
index 0b7d22e..d7757b4 100644
--- a/src/gs-category.c
+++ b/src/gs-category.c
@@ -28,8 +28,6 @@
static void gs_category_finalize (GObject *object);
-#define GS_CATEGORY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GS_TYPE_CATEGORY, GsCategoryPrivate))
-
struct GsCategoryPrivate
{
gchar *id;
@@ -39,7 +37,7 @@ struct GsCategoryPrivate
GList *subcategories;
};
-G_DEFINE_TYPE (GsCategory, gs_category, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GsCategory, gs_category, G_TYPE_OBJECT)
/**
* gs_category_get_size:
@@ -187,13 +185,12 @@ gs_category_class_init (GsCategoryClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gs_category_finalize;
- g_type_class_add_private (klass, sizeof (GsCategoryPrivate));
}
static void
gs_category_init (GsCategory *category)
{
- category->priv = GS_CATEGORY_GET_PRIVATE (category);
+ category->priv = gs_category_get_instance_private (category);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]