diff --git a/src/settings/nm-secret-agent.c b/src/settings/nm-secret-agent.c index 82a8c904a5..480e774241 100644 --- a/src/settings/nm-secret-agent.c +++ b/src/settings/nm-secret-agent.c @@ -34,33 +34,28 @@ enum { static guint signals[LAST_SIGNAL] = { 0 }; -typedef struct { +typedef struct _NMSecretAgentPrivate { CList permissions; + CList requests; + GDBusConnection *dbus_connection; char *description; NMAuthSubject *subject; char *identifier; char *owner_username; char *dbus_owner; - GDBusConnection *dbus_connection; GCancellable *name_owner_cancellable; - CList requests; - NMSecretAgentCapabilities capabilities; guint name_owner_changed_id; + NMSecretAgentCapabilities capabilities; bool shutdown_wait_obj_registered:1; } NMSecretAgentPrivate; -struct _NMSecretAgent { - GObject parent; - NMSecretAgentPrivate _priv; -}; - struct _NMSecretAgentClass { GObjectClass parent; }; G_DEFINE_TYPE (NMSecretAgent, nm_secret_agent, G_TYPE_OBJECT) -#define NM_SECRET_AGENT_GET_PRIVATE(self) _NM_GET_PRIVATE (self, NMSecretAgent, NM_IS_SECRET_AGENT) +#define NM_SECRET_AGENT_GET_PRIVATE(self) _NM_GET_PRIVATE_PTR (self, NMSecretAgent, NM_IS_SECRET_AGENT) /*****************************************************************************/ @@ -765,7 +760,11 @@ nm_secret_agent_new (GDBusMethodInvocation *context, static void nm_secret_agent_init (NMSecretAgent *self) { - NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (self); + NMSecretAgentPrivate *priv; + + priv = G_TYPE_INSTANCE_GET_PRIVATE (self, NM_TYPE_SECRET_AGENT, NMSecretAgentPrivate); + + self->_priv = priv; c_list_init (&priv->permissions); c_list_init (&priv->requests); @@ -814,6 +813,8 @@ nm_secret_agent_class_init (NMSecretAgentClass *config_class) { GObjectClass *object_class = G_OBJECT_CLASS (config_class); + g_type_class_add_private (object_class, sizeof (NMSecretAgentPrivate)); + object_class->dispose = dispose; object_class->finalize = finalize; diff --git a/src/settings/nm-secret-agent.h b/src/settings/nm-secret-agent.h index ea86e432ad..d6e2feba66 100644 --- a/src/settings/nm-secret-agent.h +++ b/src/settings/nm-secret-agent.h @@ -20,6 +20,13 @@ typedef struct _NMSecretAgentClass NMSecretAgentClass; typedef struct _NMSecretAgentCallId NMSecretAgentCallId; +struct _NMSecretAgentPrivate; + +struct _NMSecretAgent { + GObject parent; + struct _NMSecretAgentPrivate *_priv; +}; + GType nm_secret_agent_get_type (void); NMSecretAgent *nm_secret_agent_new (GDBusMethodInvocation *context,