[gnome-settings-daemon] power: Fix compilation warnings



commit c9383840d214929287572c363b3036e8902d3fec
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Jan 25 19:14:44 2013 +0100

    power: Fix compilation warnings

 plugins/power/gsd-power-manager.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index b5fc3fb..f0451d6 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2665,10 +2665,11 @@ idle_is_session_inhibited (GsdPowerManager  *manager,
 
         variant = g_dbus_proxy_get_cached_property (manager->priv->session,
                                                     "InhibitedActions");
-        if (variant) {
-                inhibited_actions = g_variant_get_uint32 (variant);
-                g_variant_unref (variant);
-        }
+        if (!variant)
+                return FALSE;
+
+        inhibited_actions = g_variant_get_uint32 (variant);
+        g_variant_unref (variant);
 
         *is_inhibited = (inhibited_actions & mask);
 
@@ -2746,6 +2747,7 @@ idle_configure (GsdPowerManager *manager)
          * and we aren't inhibited from sleeping (or logging out, etc.) */
         action_type = g_settings_get_enum (manager->priv->settings, on_battery ?
                                            "sleep-inactive-battery-type" : "sleep-inactive-ac-type");
+        timeout_sleep = 0;
         if (!is_action_inhibited (manager, action_type)) {
                 timeout_sleep = g_settings_get_int (manager->priv->settings, on_battery ?
                                                     "sleep-inactive-battery-timeout" : "sleep-inactive-ac-timeout");



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