[gnome-online-accounts] mail-auth, mail-client: Use the name 'self' to refer to the instance



commit 5e07bee823b351bcb77539355fdcbc3e23780ce4
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon May 11 15:02:53 2015 +0200

    mail-auth, mail-client: Use the name 'self' to refer to the instance

 src/goabackend/goamailauth.c   |   76 ++++++++++++++++++++--------------------
 src/goabackend/goamailauth.h   |   30 ++++++++--------
 src/goabackend/goamailclient.c |   18 +++++-----
 src/goabackend/goamailclient.h |    8 ++--
 4 files changed, 66 insertions(+), 66 deletions(-)
---
diff --git a/src/goabackend/goamailauth.c b/src/goabackend/goamailauth.c
index 5e9b7d1..db8570d 100644
--- a/src/goabackend/goamailauth.c
+++ b/src/goabackend/goamailauth.c
@@ -1,6 +1,6 @@
 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 /*
- * Copyright (C) 2011, 2013 Red Hat, Inc.
+ * Copyright (C) 2011, 2013, 2015 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -88,8 +88,8 @@ mail_auth_starttls_in_thread_func (GSimpleAsyncResult *res, GObject *object, GCa
 static void
 goa_mail_auth_dispose (GObject *object)
 {
-  GoaMailAuth *auth = GOA_MAIL_AUTH (object);
-  GoaMailAuthPrivate *priv = auth->priv;
+  GoaMailAuth *self = GOA_MAIL_AUTH (object);
+  GoaMailAuthPrivate *priv = self->priv;
 
   g_clear_object (&priv->input);
   g_clear_object (&priv->output);
@@ -103,8 +103,8 @@ goa_mail_auth_get_property (GObject      *object,
                             GValue       *value,
                             GParamSpec   *pspec)
 {
-  GoaMailAuth *auth = GOA_MAIL_AUTH (object);
-  GoaMailAuthPrivate *priv = auth->priv;
+  GoaMailAuth *self = GOA_MAIL_AUTH (object);
+  GoaMailAuthPrivate *priv = self->priv;
 
   switch (prop_id)
     {
@@ -128,8 +128,8 @@ goa_mail_auth_set_property (GObject      *object,
                             const GValue *value,
                             GParamSpec   *pspec)
 {
-  GoaMailAuth *auth = GOA_MAIL_AUTH (object);
-  GoaMailAuthPrivate *priv = auth->priv;
+  GoaMailAuth *self = GOA_MAIL_AUTH (object);
+  GoaMailAuthPrivate *priv = self->priv;
 
   switch (prop_id)
     {
@@ -150,9 +150,9 @@ goa_mail_auth_set_property (GObject      *object,
 /* ---------------------------------------------------------------------------------------------------- */
 
 static void
-goa_mail_auth_init (GoaMailAuth *client)
+goa_mail_auth_init (GoaMailAuth *self)
 {
-  client->priv = G_TYPE_INSTANCE_GET_PRIVATE (client, GOA_TYPE_MAIL_AUTH, GoaMailAuthPrivate);
+  self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GOA_TYPE_MAIL_AUTH, GoaMailAuthPrivate);
 }
 
 static void
@@ -188,38 +188,38 @@ goa_mail_auth_class_init (GoaMailAuthClass *klass)
 /* ---------------------------------------------------------------------------------------------------- */
 
 gboolean
-goa_mail_auth_is_needed (GoaMailAuth *auth)
+goa_mail_auth_is_needed (GoaMailAuth *self)
 {
-  g_return_val_if_fail (GOA_IS_MAIL_AUTH (auth), FALSE);
-  return GOA_MAIL_AUTH_GET_CLASS (auth)->is_needed (auth);
+  g_return_val_if_fail (GOA_IS_MAIL_AUTH (self), FALSE);
+  return GOA_MAIL_AUTH_GET_CLASS (self)->is_needed (self);
 }
 
 /* ---------------------------------------------------------------------------------------------------- */
 
 gboolean
-goa_mail_auth_run_sync (GoaMailAuth         *auth,
+goa_mail_auth_run_sync (GoaMailAuth         *self,
                         GCancellable        *cancellable,
                         GError             **error)
 {
-  g_return_val_if_fail (GOA_IS_MAIL_AUTH (auth), FALSE);
+  g_return_val_if_fail (GOA_IS_MAIL_AUTH (self), FALSE);
   g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE);
-  return GOA_MAIL_AUTH_GET_CLASS (auth)->run_sync (auth, cancellable, error);
+  return GOA_MAIL_AUTH_GET_CLASS (self)->run_sync (self, cancellable, error);
 }
 
 /* ---------------------------------------------------------------------------------------------------- */
 
 void
-goa_mail_auth_run (GoaMailAuth         *auth,
+goa_mail_auth_run (GoaMailAuth         *self,
                    GCancellable        *cancellable,
                    GAsyncReadyCallback  callback,
                    gpointer             user_data)
 {
   GSimpleAsyncResult *simple;
 
-  g_return_if_fail (GOA_IS_MAIL_AUTH (auth));
+  g_return_if_fail (GOA_IS_MAIL_AUTH (self));
   g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
 
-  simple = g_simple_async_result_new (G_OBJECT (auth), callback, user_data, goa_mail_auth_run);
+  simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data, goa_mail_auth_run);
   g_simple_async_result_set_handle_cancellation (simple, TRUE);
 
   g_simple_async_result_run_in_thread (simple, mail_auth_run_in_thread_func, G_PRIORITY_DEFAULT, 
cancellable);
@@ -228,13 +228,13 @@ goa_mail_auth_run (GoaMailAuth         *auth,
 }
 
 gboolean
-goa_mail_auth_run_finish (GoaMailAuth         *auth,
+goa_mail_auth_run_finish (GoaMailAuth         *self,
                           GAsyncResult        *res,
                           GError             **error)
 {
   GSimpleAsyncResult *simple;
 
-  g_return_val_if_fail (g_simple_async_result_is_valid (res, G_OBJECT (auth), goa_mail_auth_run), FALSE);
+  g_return_val_if_fail (g_simple_async_result_is_valid (res, G_OBJECT (self), goa_mail_auth_run), FALSE);
   g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
   simple = G_SIMPLE_ASYNC_RESULT (res);
@@ -248,29 +248,29 @@ goa_mail_auth_run_finish (GoaMailAuth         *auth,
 /* ---------------------------------------------------------------------------------------------------- */
 
 gboolean
-goa_mail_auth_starttls_sync (GoaMailAuth         *auth,
+goa_mail_auth_starttls_sync (GoaMailAuth         *self,
                              GCancellable        *cancellable,
                              GError             **error)
 {
-  g_return_val_if_fail (GOA_IS_MAIL_AUTH (auth), FALSE);
+  g_return_val_if_fail (GOA_IS_MAIL_AUTH (self), FALSE);
   g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE);
-  return GOA_MAIL_AUTH_GET_CLASS (auth)->starttls_sync (auth, cancellable, error);
+  return GOA_MAIL_AUTH_GET_CLASS (self)->starttls_sync (self, cancellable, error);
 }
 
 /* ---------------------------------------------------------------------------------------------------- */
 
 void
-goa_mail_auth_starttls (GoaMailAuth         *auth,
+goa_mail_auth_starttls (GoaMailAuth         *self,
                         GCancellable        *cancellable,
                         GAsyncReadyCallback  callback,
                         gpointer             user_data)
 {
   GSimpleAsyncResult *simple;
 
-  g_return_if_fail (GOA_IS_MAIL_AUTH (auth));
+  g_return_if_fail (GOA_IS_MAIL_AUTH (self));
   g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
 
-  simple = g_simple_async_result_new (G_OBJECT (auth), callback, user_data, goa_mail_auth_starttls);
+  simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data, goa_mail_auth_starttls);
   g_simple_async_result_set_handle_cancellation (simple, TRUE);
 
   g_simple_async_result_run_in_thread (simple,
@@ -282,13 +282,13 @@ goa_mail_auth_starttls (GoaMailAuth         *auth,
 }
 
 gboolean
-goa_mail_auth_starttls_finish (GoaMailAuth         *auth,
+goa_mail_auth_starttls_finish (GoaMailAuth         *self,
                                GAsyncResult        *res,
                                GError             **error)
 {
   GSimpleAsyncResult *simple;
 
-  g_return_val_if_fail (g_simple_async_result_is_valid (res, G_OBJECT (auth), goa_mail_auth_starttls), 
FALSE);
+  g_return_val_if_fail (g_simple_async_result_is_valid (res, G_OBJECT (self), goa_mail_auth_starttls), 
FALSE);
   g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
   simple = G_SIMPLE_ASYNC_RESULT (res);
@@ -302,41 +302,41 @@ goa_mail_auth_starttls_finish (GoaMailAuth         *auth,
 /* ---------------------------------------------------------------------------------------------------- */
 
 GDataInputStream *
-goa_mail_auth_get_input (GoaMailAuth *auth)
+goa_mail_auth_get_input (GoaMailAuth *self)
 {
-  return auth->priv->input;
+  return self->priv->input;
 }
 
 void
-goa_mail_auth_set_input (GoaMailAuth      *auth,
+goa_mail_auth_set_input (GoaMailAuth      *self,
                          GDataInputStream *input)
 {
-  GoaMailAuthPrivate *priv = auth->priv;
+  GoaMailAuthPrivate *priv = self->priv;
 
   if (priv->input == input)
     return;
 
   g_clear_object (&priv->input);
   priv->input = g_object_ref (input);
-  g_object_notify (G_OBJECT (auth), "input");
+  g_object_notify (G_OBJECT (self), "input");
 }
 
 GDataOutputStream *
-goa_mail_auth_get_output (GoaMailAuth  *auth)
+goa_mail_auth_get_output (GoaMailAuth  *self)
 {
-  return auth->priv->output;
+  return self->priv->output;
 }
 
 void
-goa_mail_auth_set_output (GoaMailAuth       *auth,
+goa_mail_auth_set_output (GoaMailAuth       *self,
                           GDataOutputStream *output)
 {
-  GoaMailAuthPrivate *priv = auth->priv;
+  GoaMailAuthPrivate *priv = self->priv;
 
   if (priv->output == output)
     return;
 
   g_clear_object (&priv->output);
   priv->output = g_object_ref (output);
-  g_object_notify (G_OBJECT (auth), "output");
+  g_object_notify (G_OBJECT (self), "output");
 }
diff --git a/src/goabackend/goamailauth.h b/src/goabackend/goamailauth.h
index b9c7eb6..650e475 100644
--- a/src/goabackend/goamailauth.h
+++ b/src/goabackend/goamailauth.h
@@ -1,6 +1,6 @@
 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 /*
- * Copyright (C) 2011, 2013 Red Hat, Inc.
+ * Copyright (C) 2011, 2013, 2015 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -50,42 +50,42 @@ struct _GoaMailAuth
 struct _GoaMailAuthClass
 {
   GObjectClass parent_class;
-  gboolean    (*is_needed)        (GoaMailAuth      *auth);
-  gboolean    (*run_sync)         (GoaMailAuth      *auth,
+  gboolean    (*is_needed)        (GoaMailAuth      *self);
+  gboolean    (*run_sync)         (GoaMailAuth      *self,
                                    GCancellable     *cancellable,
                                    GError          **error);
-  gboolean    (*starttls_sync)    (GoaMailAuth      *auth,
+  gboolean    (*starttls_sync)    (GoaMailAuth      *self,
                                    GCancellable     *cancellable,
                                    GError          **error);
 };
 
 GType                 goa_mail_auth_get_type           (void) G_GNUC_CONST;
-gboolean              goa_mail_auth_is_needed          (GoaMailAuth         *auth);
-void                  goa_mail_auth_run                (GoaMailAuth         *auth,
+gboolean              goa_mail_auth_is_needed          (GoaMailAuth         *self);
+void                  goa_mail_auth_run                (GoaMailAuth         *self,
                                                         GCancellable        *cancellable,
                                                         GAsyncReadyCallback  callback,
                                                         gpointer             user_data);
-gboolean              goa_mail_auth_run_finish         (GoaMailAuth         *auth,
+gboolean              goa_mail_auth_run_finish         (GoaMailAuth         *self,
                                                         GAsyncResult        *res,
                                                         GError             **error);
-gboolean              goa_mail_auth_run_sync           (GoaMailAuth         *auth,
+gboolean              goa_mail_auth_run_sync           (GoaMailAuth         *self,
                                                         GCancellable        *cancellable,
                                                         GError             **error);
-void                  goa_mail_auth_starttls           (GoaMailAuth         *auth,
+void                  goa_mail_auth_starttls           (GoaMailAuth         *self,
                                                         GCancellable        *cancellable,
                                                         GAsyncReadyCallback  callback,
                                                         gpointer             user_data);
-gboolean              goa_mail_auth_starttls_finish    (GoaMailAuth         *auth,
+gboolean              goa_mail_auth_starttls_finish    (GoaMailAuth         *self,
                                                         GAsyncResult        *res,
                                                         GError             **error);
-gboolean              goa_mail_auth_starttls_sync      (GoaMailAuth         *auth,
+gboolean              goa_mail_auth_starttls_sync      (GoaMailAuth         *self,
                                                         GCancellable        *cancellable,
                                                         GError             **error);
-GDataInputStream     *goa_mail_auth_get_input          (GoaMailAuth         *auth);
-void                  goa_mail_auth_set_input          (GoaMailAuth         *auth,
+GDataInputStream     *goa_mail_auth_get_input          (GoaMailAuth         *self);
+void                  goa_mail_auth_set_input          (GoaMailAuth         *self,
                                                         GDataInputStream    *input);
-GDataOutputStream    *goa_mail_auth_get_output         (GoaMailAuth         *auth);
-void                  goa_mail_auth_set_output         (GoaMailAuth         *auth,
+GDataOutputStream    *goa_mail_auth_get_output         (GoaMailAuth         *self);
+void                  goa_mail_auth_set_output         (GoaMailAuth         *self,
                                                         GDataOutputStream   *input);
 
 G_END_DECLS
diff --git a/src/goabackend/goamailclient.c b/src/goabackend/goamailclient.c
index e1ccaac..a85777e 100644
--- a/src/goabackend/goamailclient.c
+++ b/src/goabackend/goamailclient.c
@@ -1,6 +1,6 @@
 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 /*
- * Copyright (C) 2011, 2013, 2014 Red Hat, Inc.
+ * Copyright (C) 2011, 2013, 2014, 2015 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -44,7 +44,7 @@ G_DEFINE_TYPE (GoaMailClient, goa_mail_client, G_TYPE_OBJECT);
 /* ---------------------------------------------------------------------------------------------------- */
 
 static void
-goa_mail_client_init (GoaMailClient *client)
+goa_mail_client_init (GoaMailClient *self)
 {
 }
 
@@ -364,7 +364,7 @@ mail_client_check_connect_cb (GObject *source_object, GAsyncResult *res, gpointe
 }
 
 void
-goa_mail_client_check (GoaMailClient       *client,
+goa_mail_client_check (GoaMailClient       *self,
                        const gchar         *host_and_port,
                        GoaTlsType           tls_type,
                        gboolean             accept_ssl_errors,
@@ -376,13 +376,13 @@ goa_mail_client_check (GoaMailClient       *client,
 {
   CheckData *data;
 
-  g_return_if_fail (GOA_IS_MAIL_CLIENT (client));
+  g_return_if_fail (GOA_IS_MAIL_CLIENT (self));
   g_return_if_fail (host_and_port != NULL && host_and_port[0] != '\0');
   g_return_if_fail (GOA_IS_MAIL_AUTH (auth));
   g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
 
   data = g_slice_new0 (CheckData);
-  data->res = g_simple_async_result_new (G_OBJECT (client), callback, user_data, goa_mail_client_check);
+  data->res = g_simple_async_result_new (G_OBJECT (self), callback, user_data, goa_mail_client_check);
 
   data->sc = g_socket_client_new ();
   if (tls_type == GOA_TLS_TYPE_SSL)
@@ -412,11 +412,11 @@ goa_mail_client_check (GoaMailClient       *client,
 }
 
 gboolean
-goa_mail_client_check_finish (GoaMailClient *client, GAsyncResult *res, GError **error)
+goa_mail_client_check_finish (GoaMailClient *self, GAsyncResult *res, GError **error)
 {
   GSimpleAsyncResult *simple;
 
-  g_return_val_if_fail (g_simple_async_result_is_valid (res, G_OBJECT (client), goa_mail_client_check), 
FALSE);
+  g_return_val_if_fail (g_simple_async_result_is_valid (res, G_OBJECT (self), goa_mail_client_check), FALSE);
   g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
   simple = G_SIMPLE_ASYNC_RESULT (res);
@@ -446,7 +446,7 @@ mail_client_check_sync_cb (GObject *source_object, GAsyncResult *res, gpointer u
 }
 
 gboolean
-goa_mail_client_check_sync (GoaMailClient  *client,
+goa_mail_client_check_sync (GoaMailClient  *self,
                             const gchar    *host_and_port,
                             GoaTlsType      tls_type,
                             gboolean        accept_ssl_errors,
@@ -464,7 +464,7 @@ goa_mail_client_check_sync (GoaMailClient  *client,
   g_main_context_push_thread_default (context);
   data.loop = g_main_loop_new (context, FALSE);
 
-  goa_mail_client_check (client,
+  goa_mail_client_check (self,
                          host_and_port,
                          tls_type,
                          accept_ssl_errors,
diff --git a/src/goabackend/goamailclient.h b/src/goabackend/goamailclient.h
index fd8cdd6..827fc95 100644
--- a/src/goabackend/goamailclient.h
+++ b/src/goabackend/goamailclient.h
@@ -1,6 +1,6 @@
 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 /*
- * Copyright (C) 2011, 2013 Red Hat, Inc.
+ * Copyright (C) 2011, 2013, 2015 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -40,7 +40,7 @@ typedef struct _GoaMailClient GoaMailClient;
 
 GType           goa_mail_client_get_type          (void) G_GNUC_CONST;
 GoaMailClient  *goa_mail_client_new               (void);
-void            goa_mail_client_check             (GoaMailClient        *client,
+void            goa_mail_client_check             (GoaMailClient        *self,
                                                    const gchar          *host_and_port,
                                                    GoaTlsType            tls_type,
                                                    gboolean              accept_ssl_errors,
@@ -49,10 +49,10 @@ void            goa_mail_client_check             (GoaMailClient        *client,
                                                    GCancellable         *cancellable,
                                                    GAsyncReadyCallback   callback,
                                                    gpointer              user_data);
-gboolean        goa_mail_client_check_finish      (GoaMailClient        *client,
+gboolean        goa_mail_client_check_finish      (GoaMailClient        *self,
                                                    GAsyncResult         *res,
                                                    GError              **error);
-gboolean        goa_mail_client_check_sync        (GoaMailClient        *client,
+gboolean        goa_mail_client_check_sync        (GoaMailClient        *self,
                                                    const gchar          *host_and_port,
                                                    GoaTlsType            tls_type,
                                                    gboolean              accept_ssl_errors,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]