[gnome-online-accounts/gnome-3-14] Minor clean up



commit 249aa05f43271a7a18ef86b2622b6253e9677087
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 75a8edd..ea703ef 100644
--- a/src/daemon/goadaemon.c
+++ b/src/daemon/goadaemon.c
@@ -970,8 +970,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;
     }
 
@@ -980,8 +979,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;
     }
 
@@ -1131,8 +1129,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]