[Pkg-telepathy-commits] [telepathy-glib-1] 168/212: TpBaseConnection: use g_dbus_method_invocation_return_error_literal

Simon McVittie smcv at debian.org
Wed May 14 12:09:11 UTC 2014


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian
in repository telepathy-glib-1.

commit 5f3d83fba63f853efd63a5c6630abb3316696f52
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Fri Apr 11 14:54:07 2014 +0100

    TpBaseConnection: use g_dbus_method_invocation_return_error_literal
    
    This avoids putting a temporary GError on the stack, which was always
    slightly questionable use of the GError API.
    
    Reviewed-by: Xavier Claessens <xavier.claessens at collabora.com>
    Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
---
 telepathy-glib/base-connection.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c
index 45631fe..f7a13e9 100644
--- a/telepathy-glib/base-connection.c
+++ b/telepathy-glib/base-connection.c
@@ -2286,8 +2286,8 @@ static void conn_requests_offer_request (TpBaseConnection *self,
 
 #define RETURN_INVALID_ARGUMENT(message) \
   G_STMT_START { \
-    GError e = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, message }; \
-    g_dbus_method_invocation_return_gerror (context, &e); \
+    g_dbus_method_invocation_return_error_literal (context, TP_ERROR, \
+        TP_ERROR_INVALID_ARGUMENT, message); \
     return; \
   } G_STMT_END
 
@@ -2425,10 +2425,9 @@ conn_requests_requestotron_validate_handle (TpBaseConnection *self,
 
       if (handles == NULL)
         {
-          GError e = { TP_ERROR, TP_ERROR_NOT_AVAILABLE,
-              "entity type not supported by this connection manager" };
-
-          g_dbus_method_invocation_return_gerror (context, &e);
+          g_dbus_method_invocation_return_error_literal (context,
+              TP_ERROR, TP_ERROR_NOT_AVAILABLE,
+              "entity type not supported by this connection manager");
           return;
         }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/telepathy-glib-1.git



More information about the Pkg-telepathy-commits mailing list