This is an automated email from the git hooks/post-receive script. eric pushed a commit to branch master in repository xfce/xfce4-session.
commit 83fd4fee8697fc5da8411c99b18900d211b72d68 Author: Mikhail Efremov <s...@altlinux.org> Date: Fri Mar 20 20:54:38 2015 +0300 Fix 'shutdown' action in the fallback mode Use switch instead of multiple if..else. Signed-off-by: Eric Koegel <eric.koe...@gmail.com> --- xfce4-session/xfsm-shutdown-fallback.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/xfce4-session/xfsm-shutdown-fallback.c b/xfce4-session/xfsm-shutdown-fallback.c index 24437e8..2627788 100644 --- a/xfce4-session/xfsm-shutdown-fallback.c +++ b/xfce4-session/xfsm-shutdown-fallback.c @@ -244,26 +244,29 @@ xfsm_shutdown_fallback_try_action (XfsmShutdownType type, gint exit_status = 0; gchar *command = NULL; - if (type == XFSM_SHUTDOWN_SHUTDOWN) - action = "shutdown"; - if (type == XFSM_SHUTDOWN_RESTART) - action = "restart"; - else if (type == XFSM_SHUTDOWN_SUSPEND) - { + switch (type) + { + case XFSM_SHUTDOWN_SHUTDOWN: + action = "shutdown"; + break; + case XFSM_SHUTDOWN_RESTART: + action = "restart"; + break; + case XFSM_SHUTDOWN_SUSPEND: action = "suspend"; /* On suspend we try to lock the screen */ if (!lock_screen (error)) return FALSE; - } - else if (type == XFSM_SHUTDOWN_HIBERNATE) - { + break; + case XFSM_SHUTDOWN_HIBERNATE: action = "hibernate"; /* On hibernate we try to lock the screen */ if (!lock_screen (error)) return FALSE; - } - else + break; + default: return FALSE; + } command = g_strdup_printf ("pkexec " XFSM_SHUTDOWN_HELPER_CMD " --%s", action); ret = g_spawn_command_line_sync (command, NULL, NULL, &exit_status, error); -- To stop receiving notification emails like this one, please contact the administrator of this repository. _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits