[gnome-online-accounts] Minor clean up



commit db0a9a97f32d921f1e40f76a63222d6715b0dcd6
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Sep 30 15:58:54 2014 +0200

    Minor clean up
    
    Use g_dbus_method_invocation_take_error for consistency. It is more
    suited to what we are doing anyway.
    
    Fixes: https://bugzilla.gnome.org/737656

 src/daemon/goadaemon.c             |    9 +++------
 src/goabackend/goaoauth2provider.c |    3 +--
 src/goabackend/goaoauthprovider.c  |    3 +--
 3 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/src/daemon/goadaemon.c b/src/daemon/goadaemon.c
index 1e5511b..61d9ee6 100644
--- a/src/daemon/goadaemon.c
+++ b/src/daemon/goadaemon.c
@@ -984,8 +984,7 @@ on_account_handle_remove (GoaAccount            *account,
                                   G_KEY_FILE_KEEP_COMMENTS,
                                   &error))
     {
-      g_dbus_method_invocation_return_gerror (invocation, error);
-      g_error_free (error);
+      g_dbus_method_invocation_take_error (invocation, error);
       goto out;
     }
 
@@ -994,8 +993,7 @@ on_account_handle_remove (GoaAccount            *account,
   error = NULL;
   if (!g_key_file_remove_group (key_file, group, &error))
     {
-      g_dbus_method_invocation_return_gerror (invocation, error);
-      g_error_free (error);
+      g_dbus_method_invocation_take_error (invocation, error);
       goto out;
     }
 
@@ -1145,8 +1143,7 @@ ensure_credentials_cb (GoaProvider   *provider,
                          error->message, g_quark_to_string (error->domain), error->code);
             }
         }
-      g_dbus_method_invocation_return_gerror (data->invocation, error);
-      g_error_free (error);
+      g_dbus_method_invocation_take_error (data->invocation, error);
     }
   else
     {
diff --git a/src/goabackend/goaoauth2provider.c b/src/goabackend/goaoauth2provider.c
index be7621d..c81949c 100644
--- a/src/goabackend/goaoauth2provider.c
+++ b/src/goabackend/goaoauth2provider.c
@@ -1781,8 +1781,7 @@ on_handle_get_access_token (GoaOAuth2Based        *interface,
                                                             &error);
   if (access_token == NULL)
     {
-      g_dbus_method_invocation_return_gerror (invocation, error);
-      g_error_free (error);
+      g_dbus_method_invocation_take_error (invocation, error);
     }
   else
     {
diff --git a/src/goabackend/goaoauthprovider.c b/src/goabackend/goaoauthprovider.c
index d1d7992..6225aff 100644
--- a/src/goabackend/goaoauthprovider.c
+++ b/src/goabackend/goaoauthprovider.c
@@ -1726,8 +1726,7 @@ on_handle_get_access_token (GoaOAuthBased         *interface,
                                                                    &error);
   if (access_token == NULL)
     {
-      g_dbus_method_invocation_return_gerror (invocation, error);
-      g_error_free (error);
+      g_dbus_method_invocation_take_error (invocation, error);
     }
   else
     {


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