[empathy] goa-auth-handler: factor out auth_data_new()
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] goa-auth-handler: factor out auth_data_new()
- Date: Fri, 3 Aug 2012 07:52:38 +0000 (UTC)
commit 7c54415fc4b9d9751ce2bcadcbd5e53d511ab42c
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Fri Aug 3 09:28:49 2012 +0200
goa-auth-handler: factor out auth_data_new()
We already have the _free() function and it makes easier to track the
lifecycle of the struct.
https://bugzilla.gnome.org/show_bug.cgi?id=680952
libempathy/empathy-goa-auth-handler.c | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/libempathy/empathy-goa-auth-handler.c b/libempathy/empathy-goa-auth-handler.c
index 260ba12..9996894 100644
--- a/libempathy/empathy-goa-auth-handler.c
+++ b/libempathy/empathy-goa-auth-handler.c
@@ -86,6 +86,21 @@ typedef struct
gchar *access_token;
} AuthData;
+static AuthData *
+auth_data_new (EmpathyGoaAuthHandler *self,
+ TpChannel *channel,
+ TpAccount *account)
+{
+ AuthData *data;
+
+ data = g_slice_new0 (AuthData);
+ data->self = g_object_ref (self);
+ data->channel = g_object_ref (channel);
+ data->account = g_object_ref (account);
+
+ return data;
+}
+
static void
auth_data_free (AuthData *data)
{
@@ -300,10 +315,7 @@ empathy_goa_auth_handler_start (EmpathyGoaAuthHandler *self,
DEBUG ("Start Goa auth for account: %s",
tp_proxy_get_object_path (account));
- data = g_slice_new0 (AuthData);
- data->self = g_object_ref (self);
- data->channel = g_object_ref (channel);
- data->account = g_object_ref (account);
+ data = auth_data_new (self, channel, account);
if (self->priv->client == NULL)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]