clients/secret-agent: embed private data in NMSecretAgentSimple class

This commit is contained in:
Thomas Haller 2019-01-22 10:19:35 +01:00
parent a6600f5ae6
commit 9d1becb0dd
2 changed files with 12 additions and 10 deletions

View file

@ -70,9 +70,18 @@ typedef struct {
gboolean enabled;
} NMSecretAgentSimplePrivate;
struct _NMSecretAgentSimple {
NMSecretAgentOld parent;
NMSecretAgentSimplePrivate _priv;
};
struct _NMSecretAgentSimpleClass {
NMSecretAgentOldClass parent;
};
G_DEFINE_TYPE (NMSecretAgentSimple, nm_secret_agent_simple, NM_TYPE_SECRET_AGENT_OLD)
#define NM_SECRET_AGENT_SIMPLE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SECRET_AGENT_SIMPLE, NMSecretAgentSimplePrivate))
#define NM_SECRET_AGENT_SIMPLE_GET_PRIVATE(self) _NM_GET_PRIVATE (self, NMSecretAgentSimple, NM_IS_SECRET_AGENT_SIMPLE, NMSecretAgentOld)
/*****************************************************************************/
@ -1160,8 +1169,6 @@ nm_secret_agent_simple_class_init (NMSecretAgentSimpleClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
NMSecretAgentOldClass *agent_class = NM_SECRET_AGENT_OLD_CLASS (klass);
g_type_class_add_private (klass, sizeof (NMSecretAgentSimplePrivate));
gobject_class->finalize = nm_secret_agent_simple_finalize;
agent_class->get_secrets = nm_secret_agent_simple_get_secrets;

View file

@ -51,13 +51,8 @@ typedef struct {
#define NM_SECRET_AGENT_SIMPLE_REQUEST_SECRETS "request-secrets"
typedef struct {
NMSecretAgentOld parent;
} NMSecretAgentSimple;
typedef struct {
NMSecretAgentOldClass parent;
} NMSecretAgentSimpleClass;
typedef struct _NMSecretAgentSimple NMSecretAgentSimple;
typedef struct _NMSecretAgentSimpleClass NMSecretAgentSimpleClass;
GType nm_secret_agent_simple_get_type (void);