diff options
-rw-r--r-- | src/settings/nm-secret-agent.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/src/settings/nm-secret-agent.c b/src/settings/nm-secret-agent.c index fbff1ee272..99b955ed4a 100644 --- a/src/settings/nm-secret-agent.c +++ b/src/settings/nm-secret-agent.c @@ -118,9 +118,7 @@ struct _NMSecretAgentCallId { gpointer callback_data; }; -typedef struct _NMSecretAgentCallId Request; - -static Request * +static NMSecretAgentCallId * request_new (NMSecretAgent *self, const char *dbus_command, /* this must be a static string. */ const char *path, @@ -128,9 +126,9 @@ request_new (NMSecretAgent *self, NMSecretAgentCallback callback, gpointer callback_data) { - Request *r; + NMSecretAgentCallId *r; - r = g_slice_new0 (Request); + r = g_slice_new0 (NMSecretAgentCallId); r->agent = self; r->path = g_strdup (path); r->setting_name = g_strdup (setting_name); @@ -146,7 +144,7 @@ request_new (NMSecretAgent *self, #define request_new(self,dbus_command,path,setting_name,callback,callback_data) request_new(self,""dbus_command"",path,setting_name,callback,callback_data) static void -request_free (Request *r) +request_free (NMSecretAgentCallId *r) { NMSecretAgent *self = r->agent; @@ -156,11 +154,11 @@ request_free (Request *r) g_free (r->setting_name); if (r->cancellable) g_object_unref (r->cancellable); - g_slice_free (Request, r); + g_slice_free (NMSecretAgentCallId, r); } static gboolean -request_check_return (Request *r) +request_check_return (NMSecretAgentCallId *r) { if (!r->cancellable) return FALSE; @@ -336,7 +334,7 @@ get_callback (GObject *proxy, GAsyncResult *result, gpointer user_data) { - Request *r = user_data; + NMSecretAgentCallId *r = user_data; if (request_check_return (r)) { NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (r->agent); @@ -365,7 +363,7 @@ nm_secret_agent_get_secrets (NMSecretAgent *self, NMSecretAgentPrivate *priv; static const char *no_hints[] = { NULL }; GVariant *dict; - Request *r; + NMSecretAgentCallId *r; g_return_val_if_fail (NM_IS_SECRET_AGENT (self), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); @@ -418,7 +416,7 @@ cancel_done (GObject *proxy, GAsyncResult *result, gpointer user_data) } static void -do_cancel_secrets (NMSecretAgent *self, Request *r, gboolean disposing) +do_cancel_secrets (NMSecretAgent *self, NMSecretAgentCallId *r, gboolean disposing) { NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (self); GCancellable *cancellable; @@ -476,7 +474,7 @@ do_cancel_secrets (NMSecretAgent *self, Request *r, gboolean disposing) void nm_secret_agent_cancel_secrets (NMSecretAgent *self, NMSecretAgentCallId *call_id) { - Request *r = call_id; + NMSecretAgentCallId *r = call_id; g_return_if_fail (NM_IS_SECRET_AGENT (self)); g_return_if_fail (r); @@ -496,7 +494,7 @@ agent_save_cb (GObject *proxy, GAsyncResult *result, gpointer user_data) { - Request *r = user_data; + NMSecretAgentCallId *r = user_data; if (request_check_return (r)) { NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (r->agent); @@ -520,7 +518,7 @@ nm_secret_agent_save_secrets (NMSecretAgent *self, { NMSecretAgentPrivate *priv; GVariant *dict; - Request *r; + NMSecretAgentCallId *r; g_return_val_if_fail (NM_IS_SECRET_AGENT (self), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); @@ -548,7 +546,7 @@ agent_delete_cb (GObject *proxy, GAsyncResult *result, gpointer user_data) { - Request *r = user_data; + NMSecretAgentCallId *r = user_data; if (request_check_return (r)) { NMSecretAgentPrivate *priv = NM_SECRET_AGENT_GET_PRIVATE (r->agent); @@ -572,7 +570,7 @@ nm_secret_agent_delete_secrets (NMSecretAgent *self, { NMSecretAgentPrivate *priv; GVariant *dict; - Request *r; + NMSecretAgentCallId *r; g_return_val_if_fail (NM_IS_SECRET_AGENT (self), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); @@ -769,7 +767,7 @@ dispose (GObject *object) again: c_list_for_each (iter, &priv->requests) { c_list_unlink_init (iter); - do_cancel_secrets (self, c_list_entry (iter, Request, lst), TRUE); + do_cancel_secrets (self, c_list_entry (iter, NMSecretAgentCallId, lst), TRUE); goto again; } |