[gom] gom: command: use G_ADD_PRIVATE for type definition
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gom] gom: command: use G_ADD_PRIVATE for type definition
- Date: Tue, 18 Feb 2020 15:05:26 +0000 (UTC)
commit d26a07cdc8617d1cc4b802ae0a81140488fca275
Author: Victor Toso <me victortoso com>
Date: Mon Feb 17 23:48:35 2020 +0100
gom: command: 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-command.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/gom/gom-command.c b/gom/gom-command.c
index abad299..8824420 100644
--- a/gom/gom-command.c
+++ b/gom/gom-command.c
@@ -23,8 +23,6 @@
#include "gom-command.h"
#include "gom-error.h"
-G_DEFINE_TYPE(GomCommand, gom_command, G_TYPE_OBJECT)
-
struct _GomCommandPrivate
{
GomAdapter *adapter;
@@ -35,6 +33,8 @@ struct _GomCommandPrivate
GPtrArray *blobs;
};
+G_DEFINE_TYPE_WITH_PRIVATE(GomCommand, gom_command, G_TYPE_OBJECT)
+
enum
{
PROP_0,
@@ -545,7 +545,6 @@ gom_command_class_init (GomCommandClass *klass)
object_class->finalize = gom_command_finalize;
object_class->get_property = gom_command_get_property;
object_class->set_property = gom_command_set_property;
- g_type_class_add_private(object_class, sizeof(GomCommandPrivate));
gParamSpecs[PROP_ADAPTER] =
g_param_spec_object("adapter",
@@ -575,9 +574,6 @@ gom_command_class_init (GomCommandClass *klass)
static void
gom_command_init (GomCommand *command)
{
- command->priv =
- G_TYPE_INSTANCE_GET_PRIVATE(command,
- GOM_TYPE_COMMAND,
- GomCommandPrivate);
+ command->priv = gom_command_get_instance_private(command);
command->priv->blobs = g_ptr_array_new_with_free_func ((GDestroyNotify) g_bytes_unref);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]