[gnome-settings-daemon] power: Use g_dbus_method_invocation_take_error()



commit 76fe35d0620f4a226cae35504d34dc08108293a5
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Jan 17 00:17:12 2013 +0100

    power: Use g_dbus_method_invocation_take_error()
    
    Instead of g_dbus_method_invocation_return_gerror() and freeing the
    error.

 plugins/power/gsd-power-manager.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 77a0de9..64c546a 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -3708,9 +3708,8 @@ handle_method_call_keyboard (GsdPowerManager *manager,
 
         /* return value */
         if (!ret) {
-                g_dbus_method_invocation_return_gerror (invocation,
-                                                        error);
-                g_error_free (error);
+                g_dbus_method_invocation_take_error (invocation,
+                                                     error);
         } else {
                 percentage = ABS_TO_PERCENTAGE (0,
                                                 manager->priv->kbd_brightness_max,
@@ -3761,9 +3760,8 @@ handle_method_call_screen (GsdPowerManager *manager,
 
         /* return value */
         if (value < 0) {
-                g_dbus_method_invocation_return_gerror (invocation,
-                                                        error);
-                g_error_free (error);
+                g_dbus_method_invocation_take_error (invocation,
+                                                     error);
         } else {
                 g_dbus_method_invocation_return_value (invocation,
                                                        g_variant_new ("(u)",



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