[gom] gom: filter: use G_ADD_PRIVATE for type definition
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gom] gom: filter: use G_ADD_PRIVATE for type definition
- Date: Tue, 18 Feb 2020 15:05:31 +0000 (UTC)
commit fd3a992cc23a1bef6336b72c507fb06224ebfb96
Author: Victor Toso <me victortoso com>
Date: Mon Feb 17 23:50:47 2020 +0100
gom: filter: use G_ADD_PRIVATE for type definition
The G_DEFINE_TYPE_WITH_PRIVATE call was moved as it needs to know the
storage size of private structure.
gom/gom-filter.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/gom/gom-filter.c b/gom/gom-filter.c
index 5e9618a..43085cf 100644
--- a/gom/gom-filter.c
+++ b/gom/gom-filter.c
@@ -21,8 +21,6 @@
#include "gom-filter.h"
#include "gom-resource.h"
-G_DEFINE_TYPE(GomFilter, gom_filter, G_TYPE_INITIALLY_UNOWNED)
-
struct _GomFilterPrivate
{
GomFilterMode mode;
@@ -37,6 +35,8 @@ struct _GomFilterPrivate
GQueue *subfilters;
};
+G_DEFINE_TYPE_WITH_PRIVATE(GomFilter, gom_filter, G_TYPE_INITIALLY_UNOWNED)
+
enum
{
PROP_0,
@@ -696,7 +696,6 @@ gom_filter_class_init (GomFilterClass *klass)
object_class->finalize = gom_filter_finalize;
object_class->get_property = gom_filter_get_property;
object_class->set_property = gom_filter_set_property;
- g_type_class_add_private(object_class, sizeof(GomFilterPrivate));
gParamSpecs[PROP_MODE] =
g_param_spec_enum("mode",
@@ -727,10 +726,7 @@ gom_filter_class_init (GomFilterClass *klass)
static void
gom_filter_init (GomFilter *filter)
{
- filter->priv =
- G_TYPE_INSTANCE_GET_PRIVATE(filter,
- GOM_TYPE_FILTER,
- GomFilterPrivate);
+ filter->priv = gom_filter_get_instance_private(filter);
filter->priv->mode = GOM_FILTER_SQL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]