[Xfce4-commits] <xfce4-session:master> Remove trailing white spaces and fix indentation in a lot of places...
Jérôme Guelfucci
noreply at xfce.org
Wed Sep 29 18:56:01 CEST 2010
Updating branch refs/heads/master
to 621c972cd9f36b7a9bc5e42612b2161a56035520 (commit)
from 8e192f945cb01eba2bcf7e042f4a6dc5f8ec0747 (commit)
commit 621c972cd9f36b7a9bc5e42612b2161a56035520
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date: Wed Sep 29 18:55:03 2010 +0200
Remove trailing white spaces and fix indentation in a lot of places...
xfce4-session-logout/main.c | 4 +-
xfce4-session/ice-layer.c | 30 +-
xfce4-session/shutdown.c | 54 +-
xfce4-session/shutdown.h | 4 +-
xfce4-session/sm-layer.c | 54 +-
xfce4-session/sm-layer.h | 4 +-
xfce4-session/xfsm-chooser.c | 10 +-
xfce4-session/xfsm-chooser.h | 4 +-
xfce4-session/xfsm-client-dbus.h | 266 +++++++++
xfce4-session/xfsm-client.c | 9 +-
xfce4-session/xfsm-client.h | 4 +-
xfce4-session/xfsm-compat-gnome.c | 14 +-
xfce4-session/xfsm-compat-gnome.h | 4 +-
xfce4-session/xfsm-compat-kde.c | 4 +-
xfce4-session/xfsm-compat-kde.h | 4 +-
xfce4-session/xfsm-dns.c | 4 +-
xfce4-session/xfsm-dns.h | 4 +-
xfce4-session/xfsm-fadeout.c | 4 +-
xfce4-session/xfsm-fadeout.h | 4 +-
xfce4-session/xfsm-global.c | 8 +-
xfce4-session/xfsm-global.h | 8 +-
xfce4-session/xfsm-legacy.c | 10 +-
xfce4-session/xfsm-legacy.h | 4 +-
xfce4-session/xfsm-manager.c | 90 ++--
xfce4-session/xfsm-manager.h | 4 +-
xfce4-session/xfsm-properties.c | 40 +-
xfce4-session/xfsm-properties.h | 6 +-
xfce4-session/xfsm-shutdown-helper.c | 987 +++++++++++++++++-----------------
28 files changed, 948 insertions(+), 694 deletions(-)
diff --git a/xfce4-session-logout/main.c b/xfce4-session-logout/main.c
index 6cf8c2c..cb0b8f9 100644
--- a/xfce4-session-logout/main.c
+++ b/xfce4-session-logout/main.c
@@ -8,12 +8,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
diff --git a/xfce4-session/ice-layer.c b/xfce4-session/ice-layer.c
index 7fec19e..8ba194f 100644
--- a/xfce4-session/ice-layer.c
+++ b/xfce4-session/ice-layer.c
@@ -8,12 +8,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -60,18 +60,18 @@ typedef struct
/* prototypes */
-static void ice_error_handler (IceConn);
-static gboolean ice_process_messages (GIOChannel *channel,
- GIOCondition condition,
- gpointer user_data);
-static gboolean ice_connection_accept (GIOChannel *channel,
- GIOCondition condition,
- gpointer watch_data);
-static FILE *ice_tmpfile (char **name);
-static void ice_auth_add (FILE *,
- FILE *,
- char *,
- IceListenObj);
+static void ice_error_handler (IceConn);
+static gboolean ice_process_messages (GIOChannel *channel,
+ GIOCondition condition,
+ gpointer user_data);
+static gboolean ice_connection_accept (GIOChannel *channel,
+ GIOCondition condition,
+ gpointer watch_data);
+static FILE *ice_tmpfile (char **name);
+static void ice_auth_add (FILE *,
+ FILE *,
+ char *,
+ IceListenObj);
static char *auth_cleanup_file;
@@ -206,7 +206,7 @@ ice_connection_accept (GIOChannel *channel,
IceCloseConnection (ice_conn);
}
}
-
+
return TRUE;
}
diff --git a/xfce4-session/shutdown.c b/xfce4-session/shutdown.c
index b9fdc76..a32bdc7 100644
--- a/xfce4-session/shutdown.c
+++ b/xfce4-session/shutdown.c
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -195,7 +195,7 @@ shutdownDialog(const gchar *sessionName, XfsmShutdownType *shutdownType, gboolea
gboolean prompt;
gboolean show_suspend;
gboolean show_hibernate;
-
+
gboolean show_restart;
gboolean show_shutdown;
@@ -285,7 +285,7 @@ shutdownDialog(const gchar *sessionName, XfsmShutdownType *shutdownType, gboolea
accessibility = GTK_IS_ACCESSIBLE (gtk_widget_get_accessible (hidden));
- if (!accessibility)
+ if (!accessibility)
{
for (;;)
{
@@ -297,7 +297,7 @@ shutdownDialog(const gchar *sessionName, XfsmShutdownType *shutdownType, gboolea
{
break;
}
-
+
gdk_pointer_ungrab (GDK_CURRENT_TIME);
}
@@ -388,13 +388,13 @@ shutdownDialog(const gchar *sessionName, XfsmShutdownType *shutdownType, gboolea
hbox = gtk_hbox_new (TRUE, BORDER);
gtk_widget_show (hbox);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
-
+
/* logout */
logout_button = gtk_button_new ();
gtk_widget_show (logout_button);
gtk_box_pack_start (GTK_BOX (hbox), logout_button, TRUE, TRUE, 0);
- g_signal_connect (logout_button, "clicked",
+ g_signal_connect (logout_button, "clicked",
G_CALLBACK (logout_button_clicked), shutdownType);
vbox2 = gtk_vbox_new (FALSE, BORDER);
@@ -422,13 +422,13 @@ shutdownDialog(const gchar *sessionName, XfsmShutdownType *shutdownType, gboolea
label = gtk_label_new (_("Log Out"));
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0);
-
+
/* reboot */
reboot_button = gtk_button_new ();
gtk_widget_show (reboot_button);
gtk_box_pack_start (GTK_BOX (hbox), reboot_button, TRUE, TRUE, 0);
- g_signal_connect (reboot_button, "clicked",
+ g_signal_connect (reboot_button, "clicked",
G_CALLBACK (reboot_button_clicked), shutdownType);
vbox2 = gtk_vbox_new (FALSE, BORDER);
@@ -441,14 +441,14 @@ shutdownDialog(const gchar *sessionName, XfsmShutdownType *shutdownType, gboolea
32,
GTK_ICON_LOOKUP_GENERIC_FALLBACK,
NULL);
-
+
if (!icon)
icon = gtk_icon_theme_load_icon (icon_theme,
"xfsm-reboot",
32,
GTK_ICON_LOOKUP_GENERIC_FALLBACK,
NULL);
-
+
image = gtk_image_new_from_pixbuf (icon);
gtk_widget_show (image);
gtk_box_pack_start (GTK_BOX (vbox2), image, FALSE, FALSE, 0);
@@ -459,18 +459,18 @@ shutdownDialog(const gchar *sessionName, XfsmShutdownType *shutdownType, gboolea
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0);
g_object_get (shutdown_helper,
- "user-can-restart", &show_restart,
- NULL);
+ "user-can-restart", &show_restart,
+ NULL);
if (!kiosk_can_shutdown || !show_restart )
gtk_widget_set_sensitive (reboot_button, FALSE);
-
+
/* halt */
halt_button = gtk_button_new ();
gtk_widget_show (halt_button);
gtk_box_pack_start (GTK_BOX (hbox), halt_button, TRUE, TRUE, 0);
- g_signal_connect (halt_button, "clicked",
+ g_signal_connect (halt_button, "clicked",
G_CALLBACK (halt_button_clicked), shutdownType);
vbox2 = gtk_vbox_new (FALSE, BORDER);
@@ -500,22 +500,22 @@ shutdownDialog(const gchar *sessionName, XfsmShutdownType *shutdownType, gboolea
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0);
- g_object_get (shutdown_helper,
- "user-can-shutdown", &show_shutdown,
- NULL);
+ g_object_get (shutdown_helper,
+ "user-can-shutdown", &show_shutdown,
+ NULL);
if (!kiosk_can_shutdown || !show_shutdown)
gtk_widget_set_sensitive (halt_button, FALSE);
if (show_suspend)
g_object_get (shutdown_helper,
- "user-can-suspend", &show_suspend,
- NULL);
+ "user-can-suspend", &show_suspend,
+ NULL);
if (show_hibernate)
g_object_get (shutdown_helper,
- "user-can-hibernate", &show_hibernate,
- NULL);
+ "user-can-hibernate", &show_hibernate,
+ NULL);
if (kiosk_can_shutdown && (show_suspend || show_hibernate))
@@ -643,15 +643,15 @@ shutdownDialog(const gchar *sessionName, XfsmShutdownType *shutdownType, gboolea
result = gtk_dialog_run (GTK_DIALOG(dialog));
if (result == GTK_RESPONSE_OK) {
- *saveSession = autosave ? autosave :
+ *saveSession = autosave ? autosave :
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbox));
}
gtk_widget_hide (dialog);
g_object_get (shutdown_helper,
- "require-password", &require_password,
- NULL);
+ "require-password", &require_password,
+ NULL);
/* ask password */
if (result == GTK_RESPONSE_OK && *shutdownType != XFSM_SHUTDOWN_LOGOUT
@@ -685,7 +685,7 @@ shutdownDialog(const gchar *sessionName, XfsmShutdownType *shutdownType, gboolea
gtk_widget_grab_focus (entry);
/* Grab Keyboard and Mouse pointer */
- if (!accessibility)
+ if (!accessibility)
xfsm_window_grab_input (GTK_WINDOW (dialog));
result = gtk_dialog_run (GTK_DIALOG (dialog));
@@ -726,7 +726,7 @@ shutdownDialog(const gchar *sessionName, XfsmShutdownType *shutdownType, gboolea
gtk_widget_show_now (dialog);
/* Grab Keyboard and Mouse pointer */
- if (!accessibility)
+ if (!accessibility)
xfsm_window_grab_input (GTK_WINDOW (dialog));
gtk_dialog_run (GTK_DIALOG (dialog));
diff --git a/xfce4-session/shutdown.h b/xfce4-session/shutdown.h
index 2c529f0..a9b219d 100644
--- a/xfce4-session/shutdown.h
+++ b/xfce4-session/shutdown.h
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
diff --git a/xfce4-session/sm-layer.c b/xfce4-session/sm-layer.c
index 4476875..89fe6de 100644
--- a/xfce4-session/sm-layer.c
+++ b/xfce4-session/sm-layer.c
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -123,7 +123,7 @@ sm_init (XfconfChannel *channel,
}
#endif
}
-
+
if (!SmsInitialize (PACKAGE, VERSION, sm_new_client, manager, ice_auth_proc,
2048, error))
{
@@ -136,9 +136,9 @@ sm_init (XfconfChannel *channel,
fprintf (stderr, "xfce4-session: Unable to establish ICE listeners: %s\n", error);
exit (EXIT_FAILURE);
}
-
+
ice_setup_listeners (num_listeners, listen_objs, manager);
-
+
network_idlist = IceComposeNetworkIdList (num_listeners, listen_objs);
xfce_setenv ("SESSION_MANAGER", network_idlist, TRUE);
free (network_idlist);
@@ -158,7 +158,7 @@ sm_new_client (SmsConn sms_conn,
xfsm_verbose ("ICE connection fd = %d, received NEW CLIENT\n\n",
IceConnectionNumber (SmsGetIceConnection (sms_conn)));
-
+
client = xfsm_manager_new_client (manager, sms_conn, &error);
if (client == NULL)
{
@@ -174,7 +174,7 @@ sm_new_client (SmsConn sms_conn,
return False;
}
-
+
SET_CALLBACK (callbacks, register_client, client);
SET_CALLBACK (callbacks, interact_request, client);
SET_CALLBACK (callbacks, interact_done, client);
@@ -185,15 +185,15 @@ sm_new_client (SmsConn sms_conn,
SET_CALLBACK (callbacks, set_properties, client);
SET_CALLBACK (callbacks, delete_properties, client);
SET_CALLBACK (callbacks, get_properties, client);
-
+
*mask = SmsRegisterClientProcMask | SmsInteractRequestProcMask
- | SmsInteractDoneProcMask | SmsSaveYourselfRequestProcMask
+ | SmsInteractDoneProcMask | SmsSaveYourselfRequestProcMask
| SmsSaveYourselfP2RequestProcMask | SmsSaveYourselfDoneProcMask
| SmsCloseConnectionProcMask | SmsSetPropertiesProcMask
| SmsDeletePropertiesProcMask | SmsGetPropertiesProcMask;
g_object_set_data (G_OBJECT (client), "--xfsm-manager", manager);
-
+
return True;
}
@@ -205,16 +205,16 @@ sm_register_client (SmsConn sms_conn,
{
XfsmClient *client = (XfsmClient *) client_data;
Status result;
-
+
xfsm_verbose ("ICE connection fd = %d, received REGISTER CLIENT [Previous Id = %s]\n\n",
IceConnectionNumber (SmsGetIceConnection (sms_conn)),
previous_id != NULL ? previous_id : "None");
-
+
result = xfsm_manager_register_client (XFSM_CLIENT_MANAGER (client), client, previous_id);
if (previous_id != NULL)
free (previous_id);
-
+
return result;
}
@@ -228,7 +228,7 @@ sm_interact_request (SmsConn sms_conn,
xfsm_verbose ("Client Id = %s, received INTERACT REQUEST [Dialog type = %s]\n\n",
xfsm_client_get_id (client), dialog_type == SmDialogError ? "Error" : "Normal");
-
+
xfsm_manager_interact (XFSM_CLIENT_MANAGER (client), client, dialog_type);
}
@@ -242,7 +242,7 @@ sm_interact_done (SmsConn sms_conn,
xfsm_verbose ("Client Id = %s, received INTERACT DONE [Cancel shutdown = %s]\n\n",
xfsm_client_get_id (client), cancel_shutdown ? "True" : "False");
-
+
xfsm_manager_interact_done (XFSM_CLIENT_MANAGER (client), client, cancel_shutdown);
}
@@ -273,7 +273,7 @@ sm_save_yourself_request (SmsConn sms_conn,
xfsm_verbose (" Global: %s\n", global ? "True" : "False");
xfsm_verbose ("\n");
}
-
+
xfsm_manager_save_yourself (XFSM_CLIENT_MANAGER (client), client, save_type, shutdown, interact_style, fast, global);
}
@@ -286,7 +286,7 @@ sm_save_yourself_phase2_request (SmsConn sms_conn,
xfsm_verbose ("Client Id = %s, received SAVE YOURSELF PHASE2 REQUEST\n\n",
xfsm_client_get_id (client));
-
+
xfsm_manager_save_yourself_phase2 (XFSM_CLIENT_MANAGER (client), client);
}
@@ -300,7 +300,7 @@ sm_save_yourself_done (SmsConn sms_conn,
xfsm_verbose ("Client Id = %s, received SAVE YOURSELF DONE [Success = %s]\n\n",
xfsm_client_get_id (client), success ? "True" : "False");
-
+
xfsm_manager_save_yourself_done (XFSM_CLIENT_MANAGER (client), client, success);
}
@@ -322,7 +322,7 @@ sm_close_connection (SmsConn sms_conn,
xfsm_verbose (" Reason %2d: %s\n", n, reasons[n]);
xfsm_verbose ("\n");
}
-
+
xfsm_manager_close_connection (XFSM_CLIENT_MANAGER (client), client, TRUE);
if (num_reasons > 0)
@@ -339,7 +339,7 @@ sm_set_properties (SmsConn sms_conn,
XfsmClient *client = (XfsmClient *) client_data;
int n;
int i;
-
+
if (G_UNLIKELY (verbose))
{
xfsm_verbose ("Client Id = %s, received SET PROPERTIES [Num props = %d]\n",
@@ -369,10 +369,10 @@ sm_set_properties (SmsConn sms_conn,
xfsm_verbose ("\n");
}
xfsm_verbose ("\n");
- }
-
+ }
+
xfsm_client_merge_properties (client, props, num_props);
-
+
while (num_props-- > 0)
SmFreeProperty (props[num_props]);
free (props);
@@ -396,9 +396,9 @@ sm_delete_properties (SmsConn sms_conn,
xfsm_verbose (" Name: %s\n", prop_names[n]);
xfsm_verbose ("\n");
}
-
+
xfsm_client_delete_properties (client, prop_names, num_props);
-
+
while (num_props-- > 0)
free (prop_names[num_props]);
free (prop_names);
@@ -415,11 +415,11 @@ sm_get_properties (SmsConn sms_conn,
gint num_props = 0;
xfsm_verbose ("Client Id = %s, received GET PROPERTIES\n\n", properties->client_id);
-
+
xfsm_properties_extract (properties, &num_props, &props);
SmsReturnProperties (sms_conn, num_props, props);
-
+
if (num_props > 0)
{
while (num_props-- > 0)
diff --git a/xfce4-session/sm-layer.h b/xfce4-session/sm-layer.h
index 5769b9e..677be85 100644
--- a/xfce4-session/sm-layer.h
+++ b/xfce4-session/sm-layer.h
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
diff --git a/xfce4-session/xfsm-chooser.c b/xfce4-session/xfsm-chooser.c
index cf2a482..7234b5b 100644
--- a/xfce4-session/xfsm-chooser.c
+++ b/xfce4-session/xfsm-chooser.c
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -45,7 +45,7 @@
#define BORDER 6
-static void xfsm_chooser_finalize (GObject *object);
+static void xfsm_chooser_finalize (GObject *object);
static void xfsm_chooser_row_activated (GtkTreeView *treeview,
GtkTreePath *path,
GtkTreeViewColumn *column,
@@ -150,7 +150,7 @@ xfsm_chooser_init (XfsmChooser *chooser)
GtkWidget *dbox;
dbox = GTK_DIALOG (chooser)->vbox;
-
+
gtk_dialog_set_has_separator (GTK_DIALOG (chooser), FALSE);
g_signal_connect_after (G_OBJECT (chooser), "realize",
G_CALLBACK (xfsm_chooser_realized), chooser);
@@ -162,7 +162,7 @@ xfsm_chooser_init (XfsmChooser *chooser)
/* scrolled window */
swin = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swin),
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swin),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (swin),
diff --git a/xfce4-session/xfsm-chooser.h b/xfce4-session/xfsm-chooser.h
index ec845e7..2c9ffe9 100644
--- a/xfce4-session/xfsm-chooser.h
+++ b/xfce4-session/xfsm-chooser.h
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
diff --git a/xfce4-session/xfsm-client-dbus.h b/xfce4-session/xfsm-client-dbus.h
new file mode 100644
index 0000000..06545e6
--- /dev/null
+++ b/xfce4-session/xfsm-client-dbus.h
@@ -0,0 +1,266 @@
+/* Generated by dbus-binding-tool; do not edit! */
+
+
+#ifndef __dbus_glib_marshal_xfsm_client_MARSHAL_H__
+#define __dbus_glib_marshal_xfsm_client_MARSHAL_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#ifdef G_ENABLE_DEBUG
+#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v)
+#define g_marshal_value_peek_char(v) g_value_get_char (v)
+#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v)
+#define g_marshal_value_peek_int(v) g_value_get_int (v)
+#define g_marshal_value_peek_uint(v) g_value_get_uint (v)
+#define g_marshal_value_peek_long(v) g_value_get_long (v)
+#define g_marshal_value_peek_ulong(v) g_value_get_ulong (v)
+#define g_marshal_value_peek_int64(v) g_value_get_int64 (v)
+#define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v)
+#define g_marshal_value_peek_enum(v) g_value_get_enum (v)
+#define g_marshal_value_peek_flags(v) g_value_get_flags (v)
+#define g_marshal_value_peek_float(v) g_value_get_float (v)
+#define g_marshal_value_peek_double(v) g_value_get_double (v)
+#define g_marshal_value_peek_string(v) (char*) g_value_get_string (v)
+#define g_marshal_value_peek_param(v) g_value_get_param (v)
+#define g_marshal_value_peek_boxed(v) g_value_get_boxed (v)
+#define g_marshal_value_peek_pointer(v) g_value_get_pointer (v)
+#define g_marshal_value_peek_object(v) g_value_get_object (v)
+#else /* !G_ENABLE_DEBUG */
+/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
+ * Do not access GValues directly in your code. Instead, use the
+ * g_value_get_*() functions
+ */
+#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int
+#define g_marshal_value_peek_char(v) (v)->data[0].v_int
+#define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint
+#define g_marshal_value_peek_int(v) (v)->data[0].v_int
+#define g_marshal_value_peek_uint(v) (v)->data[0].v_uint
+#define g_marshal_value_peek_long(v) (v)->data[0].v_long
+#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong
+#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64
+#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64
+#define g_marshal_value_peek_enum(v) (v)->data[0].v_long
+#define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong
+#define g_marshal_value_peek_float(v) (v)->data[0].v_float
+#define g_marshal_value_peek_double(v) (v)->data[0].v_double
+#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer
+#define g_marshal_value_peek_param(v) (v)->data[0].v_pointer
+#define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer
+#define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer
+#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer
+#endif /* !G_ENABLE_DEBUG */
+
+
+/* BOOLEAN:BOXED,POINTER */
+extern void dbus_glib_marshal_xfsm_client_BOOLEAN__BOXED_POINTER (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+void
+dbus_glib_marshal_xfsm_client_BOOLEAN__BOXED_POINTER (GClosure *closure,
+ GValue *return_value G_GNUC_UNUSED,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint G_GNUC_UNUSED,
+ gpointer marshal_data)
+{
+ typedef gboolean (*GMarshalFunc_BOOLEAN__BOXED_POINTER) (gpointer data1,
+ gpointer arg_1,
+ gpointer arg_2,
+ gpointer data2);
+ register GMarshalFunc_BOOLEAN__BOXED_POINTER callback;
+ register GCClosure *cc = (GCClosure*) closure;
+ register gpointer data1, data2;
+ gboolean v_return;
+
+ g_return_if_fail (return_value != NULL);
+ g_return_if_fail (n_param_values == 3);
+
+ if (G_CCLOSURE_SWAP_DATA (closure))
+ {
+ data1 = closure->data;
+ data2 = g_value_peek_pointer (param_values + 0);
+ }
+ else
+ {
+ data1 = g_value_peek_pointer (param_values + 0);
+ data2 = closure->data;
+ }
+ callback = (GMarshalFunc_BOOLEAN__BOXED_POINTER) (marshal_data ? marshal_data : cc->callback);
+
+ v_return = callback (data1,
+ g_marshal_value_peek_boxed (param_values + 1),
+ g_marshal_value_peek_pointer (param_values + 2),
+ data2);
+
+ g_value_set_boolean (return_value, v_return);
+}
+
+/* BOOLEAN:POINTER */
+extern void dbus_glib_marshal_xfsm_client_BOOLEAN__POINTER (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+void
+dbus_glib_marshal_xfsm_client_BOOLEAN__POINTER (GClosure *closure,
+ GValue *return_value G_GNUC_UNUSED,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint G_GNUC_UNUSED,
+ gpointer marshal_data)
+{
+ typedef gboolean (*GMarshalFunc_BOOLEAN__POINTER) (gpointer data1,
+ gpointer arg_1,
+ gpointer data2);
+ register GMarshalFunc_BOOLEAN__POINTER callback;
+ register GCClosure *cc = (GCClosure*) closure;
+ register gpointer data1, data2;
+ gboolean v_return;
+
+ g_return_if_fail (return_value != NULL);
+ g_return_if_fail (n_param_values == 2);
+
+ if (G_CCLOSURE_SWAP_DATA (closure))
+ {
+ data1 = closure->data;
+ data2 = g_value_peek_pointer (param_values + 0);
+ }
+ else
+ {
+ data1 = g_value_peek_pointer (param_values + 0);
+ data2 = closure->data;
+ }
+ callback = (GMarshalFunc_BOOLEAN__POINTER) (marshal_data ? marshal_data : cc->callback);
+
+ v_return = callback (data1,
+ g_marshal_value_peek_pointer (param_values + 1),
+ data2);
+
+ g_value_set_boolean (return_value, v_return);
+}
+
+/* BOOLEAN:BOXED,POINTER,POINTER */
+extern void dbus_glib_marshal_xfsm_client_BOOLEAN__BOXED_POINTER_POINTER (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+void
+dbus_glib_marshal_xfsm_client_BOOLEAN__BOXED_POINTER_POINTER (GClosure *closure,
+ GValue *return_value G_GNUC_UNUSED,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint G_GNUC_UNUSED,
+ gpointer marshal_data)
+{
+ typedef gboolean (*GMarshalFunc_BOOLEAN__BOXED_POINTER_POINTER) (gpointer data1,
+ gpointer arg_1,
+ gpointer arg_2,
+ gpointer arg_3,
+ gpointer data2);
+ register GMarshalFunc_BOOLEAN__BOXED_POINTER_POINTER callback;
+ register GCClosure *cc = (GCClosure*) closure;
+ register gpointer data1, data2;
+ gboolean v_return;
+
+ g_return_if_fail (return_value != NULL);
+ g_return_if_fail (n_param_values == 4);
+
+ if (G_CCLOSURE_SWAP_DATA (closure))
+ {
+ data1 = closure->data;
+ data2 = g_value_peek_pointer (param_values + 0);
+ }
+ else
+ {
+ data1 = g_value_peek_pointer (param_values + 0);
+ data2 = closure->data;
+ }
+ callback = (GMarshalFunc_BOOLEAN__BOXED_POINTER_POINTER) (marshal_data ? marshal_data : cc->callback);
+
+ v_return = callback (data1,
+ g_marshal_value_peek_boxed (param_values + 1),
+ g_marshal_value_peek_pointer (param_values + 2),
+ g_marshal_value_peek_pointer (param_values + 3),
+ data2);
+
+ g_value_set_boolean (return_value, v_return);
+}
+
+/* BOOLEAN:POINTER,POINTER */
+extern void dbus_glib_marshal_xfsm_client_BOOLEAN__POINTER_POINTER (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+void
+dbus_glib_marshal_xfsm_client_BOOLEAN__POINTER_POINTER (GClosure *closure,
+ GValue *return_value G_GNUC_UNUSED,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint G_GNUC_UNUSED,
+ gpointer marshal_data)
+{
+ typedef gboolean (*GMarshalFunc_BOOLEAN__POINTER_POINTER) (gpointer data1,
+ gpointer arg_1,
+ gpointer arg_2,
+ gpointer data2);
+ register GMarshalFunc_BOOLEAN__POINTER_POINTER callback;
+ register GCClosure *cc = (GCClosure*) closure;
+ register gpointer data1, data2;
+ gboolean v_return;
+
+ g_return_if_fail (return_value != NULL);
+ g_return_if_fail (n_param_values == 3);
+
+ if (G_CCLOSURE_SWAP_DATA (closure))
+ {
+ data1 = closure->data;
+ data2 = g_value_peek_pointer (param_values + 0);
+ }
+ else
+ {
+ data1 = g_value_peek_pointer (param_values + 0);
+ data2 = closure->data;
+ }
+ callback = (GMarshalFunc_BOOLEAN__POINTER_POINTER) (marshal_data ? marshal_data : cc->callback);
+
+ v_return = callback (data1,
+ g_marshal_value_peek_pointer (param_values + 1),
+ g_marshal_value_peek_pointer (param_values + 2),
+ data2);
+
+ g_value_set_boolean (return_value, v_return);
+}
+
+G_END_DECLS
+
+#endif /* __dbus_glib_marshal_xfsm_client_MARSHAL_H__ */
+
+#include <dbus/dbus-glib.h>
+static const DBusGMethodInfo dbus_glib_xfsm_client_methods[] = {
+ { (GCallback) xfsm_client_dbus_get_id, dbus_glib_marshal_xfsm_client_BOOLEAN__POINTER_POINTER, 0 },
+ { (GCallback) xfsm_client_dbus_get_state, dbus_glib_marshal_xfsm_client_BOOLEAN__POINTER_POINTER, 44 },
+ { (GCallback) xfsm_client_dbus_get_all_sm_properties, dbus_glib_marshal_xfsm_client_BOOLEAN__POINTER_POINTER, 94 },
+ { (GCallback) xfsm_client_dbus_get_sm_properties, dbus_glib_marshal_xfsm_client_BOOLEAN__BOXED_POINTER_POINTER, 163 },
+ { (GCallback) xfsm_client_dbus_set_sm_properties, dbus_glib_marshal_xfsm_client_BOOLEAN__BOXED_POINTER, 236 },
+ { (GCallback) xfsm_client_dbus_delete_sm_properties, dbus_glib_marshal_xfsm_client_BOOLEAN__BOXED_POINTER, 298 },
+ { (GCallback) xfsm_client_dbus_terminate, dbus_glib_marshal_xfsm_client_BOOLEAN__POINTER, 355 },
+};
+
+const DBusGObjectInfo dbus_glib_xfsm_client_object_info = { 1,
+ dbus_glib_xfsm_client_methods,
+ 7,
+"org.xfce.Session.Client\0GetID\0S\0id\0O\0F\0N\0s\0\0org.xfce.Session.Client\0GetState\0S\0state\0O\0F\0N\0u\0\0org.xfce.Session.Client\0GetAllSmProperties\0S\0properties\0O\0F\0N\0a{sv}\0\0org.xfce.Session.Client\0GetSmProperties\0S\0names\0I\0as\0values\0O\0F\0N\0a{sv}\0\0org.xfce.Session.Client\0SetSmProperties\0S\0properties\0I\0a{sv}\0\0org.xfce.Session.Client\0DeleteSmProperties\0S\0names\0I\0as\0\0org.xfce.Session.Client\0Terminate\0S\0\0\0",
+"org.xfce.Session.Client\0StateChanged\0org.xfce.Session.Client\0SmPropertyChanged\0org.xfce.Session.Client\0SmPropertyDeleted\0\0",
+"\0"
+};
+
diff --git a/xfce4-session/xfsm-client.c b/xfce4-session/xfsm-client.c
index 491d013..fea8474 100644
--- a/xfce4-session/xfsm-client.c
+++ b/xfce4-session/xfsm-client.c
@@ -8,12 +8,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -237,7 +237,7 @@ xfsm_client_set_initial_properties (XfsmClient *client,
{
g_return_if_fail (XFSM_IS_CLIENT (client));
g_return_if_fail (properties != NULL);
-
+
if (client->properties != NULL)
xfsm_properties_free (client->properties);
client->properties = properties;
@@ -329,7 +329,7 @@ xfsm_client_merge_properties (XfsmClient *client,
g_return_if_fail (client->properties != NULL);
properties = client->properties;
-
+
for (n = 0; n < num_props; ++n)
{
gchar **old_discard = NULL;
@@ -584,7 +584,6 @@ xfsm_client_dbus_delete_sm_properties (XfsmClient *client,
gchar **names,
GError **error)
{
-
if (G_UNLIKELY (client->properties == NULL))
return TRUE;
diff --git a/xfce4-session/xfsm-client.h b/xfce4-session/xfsm-client.h
index 39a258e..89edce5 100644
--- a/xfce4-session/xfsm-client.h
+++ b/xfce4-session/xfsm-client.h
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
diff --git a/xfce4-session/xfsm-compat-gnome.c b/xfce4-session/xfsm-compat-gnome.c
index 22da937..62f1452 100644
--- a/xfce4-session/xfsm-compat-gnome.c
+++ b/xfce4-session/xfsm-compat-gnome.c
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -181,7 +181,7 @@ gnome_keyring_daemon_startup (void)
g_printerr ("gnome-keyring-daemon failed to start correctly, "
"exit code: %d\n", WEXITSTATUS (status));
}
-
+
g_free (sout);
}
}
@@ -208,7 +208,7 @@ gnome_ast_startup (void)
list = gconf_client_get_list (gnome_conf_client, AT_STARTUP_KEY,
GCONF_VALUE_STRING, &error);
-
+
if (error != NULL)
{
g_warning ("Failed to query value of " AT_STARTUP_KEY ": %s",
@@ -260,13 +260,13 @@ xfsm_compat_gnome_smproxy_startup (void)
*/
dpy = gdk_display;
root = RootWindow (dpy, 0);
-
+
if (gnome_smproxy_window != None)
XDestroyWindow (dpy, gnome_smproxy_window);
-
+
gnome_sm_proxy = XInternAtom (dpy, "GNOME_SM_PROXY", False);
gnome_smproxy_window = XCreateSimpleWindow (dpy, root, 1, 1, 1, 1, 0, 0, 0);
-
+
XChangeProperty (dpy, gnome_smproxy_window, gnome_sm_proxy,
XA_CARDINAL, 32, PropModeReplace,
(unsigned char *) (void *) &gnome_smproxy_window, 1);
diff --git a/xfce4-session/xfsm-compat-gnome.h b/xfce4-session/xfsm-compat-gnome.h
index a78680c..999897f 100644
--- a/xfce4-session/xfsm-compat-gnome.h
+++ b/xfce4-session/xfsm-compat-gnome.h
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
diff --git a/xfce4-session/xfsm-compat-kde.c b/xfce4-session/xfsm-compat-kde.c
index f7dab1d..69473ea 100644
--- a/xfce4-session/xfsm-compat-kde.c
+++ b/xfce4-session/xfsm-compat-kde.c
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
diff --git a/xfce4-session/xfsm-compat-kde.h b/xfce4-session/xfsm-compat-kde.h
index 1e70f80..f85808e 100644
--- a/xfce4-session/xfsm-compat-kde.h
+++ b/xfce4-session/xfsm-compat-kde.h
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
diff --git a/xfce4-session/xfsm-dns.c b/xfce4-session/xfsm-dns.c
index aab3bcb..daf260b 100644
--- a/xfce4-session/xfsm-dns.c
+++ b/xfce4-session/xfsm-dns.c
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
diff --git a/xfce4-session/xfsm-dns.h b/xfce4-session/xfsm-dns.h
index 4e7cce1..5ac421b 100644
--- a/xfce4-session/xfsm-dns.h
+++ b/xfce4-session/xfsm-dns.h
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
diff --git a/xfce4-session/xfsm-fadeout.c b/xfce4-session/xfsm-fadeout.c
index 2d63435..e112985 100644
--- a/xfce4-session/xfsm-fadeout.c
+++ b/xfce4-session/xfsm-fadeout.c
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
diff --git a/xfce4-session/xfsm-fadeout.h b/xfce4-session/xfsm-fadeout.h
index d1f4f09..5afb6da 100644
--- a/xfce4-session/xfsm-fadeout.h
+++ b/xfce4-session/xfsm-fadeout.h
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
diff --git a/xfce4-session/xfsm-global.c b/xfce4-session/xfsm-global.c
index c213482..916b08a 100644
--- a/xfce4-session/xfsm-global.c
+++ b/xfce4-session/xfsm-global.c
@@ -8,12 +8,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -80,7 +80,7 @@ xfsm_verbose_real (const gchar *format, ...)
gchar *logfile;
va_list valist;
GTimeVal tv;
-
+
if (G_UNLIKELY (fp == NULL))
{
logfile = xfce_get_homefile (".xfce4-session.verbose-log", NULL);
@@ -90,7 +90,7 @@ xfsm_verbose_real (const gchar *format, ...)
g_get_current_time(&tv);
fprintf(fp, "[%10lu] ", tv.tv_sec);
-
+
va_start (valist, format);
vfprintf (fp, format, valist);
fflush (fp);
diff --git a/xfce4-session/xfsm-global.h b/xfce4-session/xfsm-global.h
index 08adfef..3288c5f 100644
--- a/xfce4-session/xfsm-global.h
+++ b/xfce4-session/xfsm-global.h
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -47,7 +47,7 @@ struct _FailsafeClient
};
void xfsm_failsafe_client_free (FailsafeClient *fclient);
-
+
#define DEFAULT_SESSION_NAME "Default"
@@ -71,7 +71,7 @@ G_STMT_START{ \
if (G_UNLIKELY (verbose)) \
xfsm_verbose_real ( ## format); \
}G_STMT_END
-
+
#endif
void xfsm_enable_verbose (void);
diff --git a/xfce4-session/xfsm-legacy.c b/xfce4-session/xfsm-legacy.c
index 2860d26..91470cd 100644
--- a/xfce4-session/xfsm-legacy.c
+++ b/xfce4-session/xfsm-legacy.c
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -29,10 +29,10 @@
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -249,7 +249,7 @@ get_wmclientmachine (Window window)
status = XGetWMClientMachine (gdk_display, window, &tp);
if (gdk_error_trap_pop ())
return NULL;
-
+
if (status)
{
if (tp.encoding == XA_STRING && tp.format == 8 && tp.nitems != 0)
diff --git a/xfce4-session/xfsm-legacy.h b/xfce4-session/xfsm-legacy.h
index 92a5af4..c5c0e9a 100644
--- a/xfce4-session/xfsm-legacy.h
+++ b/xfce4-session/xfsm-legacy.h
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
diff --git a/xfce4-session/xfsm-manager.c b/xfce4-session/xfsm-manager.c
index 892b6c6..08c7255 100644
--- a/xfce4-session/xfsm-manager.c
+++ b/xfce4-session/xfsm-manager.c
@@ -5,18 +5,18 @@
* Copyright (c) 2010 Jannis Pohlmann <jannis at xfce.org>
* All rights reserved.
*
- * This program is free software; you can redistribute it and/or
+ * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
+ * published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the Free
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
@@ -254,7 +254,7 @@ xfsm_manager_init (XfsmManager *manager)
#ifdef ENABLE_CONSOLE_KIT
manager->system_bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
-
+
if (G_LIKELY (manager->system_bus != NULL))
{
xfsm_manager_consolekit_init (manager);
@@ -276,7 +276,7 @@ xfsm_manager_finalize (GObject *obj)
#ifdef ENABLE_CONSOLE_KIT
xfsm_manager_consolekit_cleanup (manager);
-
+
if (manager->system_bus)
dbus_g_connection_unref (manager->system_bus);
#endif /*ENABLE_CONSOLE_KIT*/
@@ -346,14 +346,14 @@ static void xfsm_manager_consolekit_init (XfsmManager *manager)
{
GError *error = NULL;
gboolean ret;
-
+
manager->consolekit_proxy = dbus_g_proxy_new_for_name_owner (manager->system_bus,
"org.freedesktop.ConsoleKit",
"/org/freedesktop/ConsoleKit/Manager",
"org.freedesktop.ConsoleKit.Manager",
NULL);
-
+
if (G_UNLIKELY (!manager->consolekit_proxy))
{
g_warning ("Failed to create proxy for 'org.freedesktop.ConsoleKit'");
@@ -364,7 +364,7 @@ static void xfsm_manager_consolekit_init (XfsmManager *manager)
if (g_getenv ("XDG_SESSION_COOKIE") != NULL)
{
#ifdef DEBUG
- g_debug ("Reusing existing ConsoleKit session: XDG_SESSION_ID=%s",
+ g_debug ("Reusing existing ConsoleKit session: XDG_SESSION_ID=%s",
g_getenv ("XDG_SESSION_COOKIE"));
#endif
}
@@ -386,7 +386,7 @@ static void xfsm_manager_consolekit_init (XfsmManager *manager)
if (g_setenv ("XDG_SESSION_COOKIE", manager->consolekit_cookie, TRUE))
{
#ifdef DEBUG
- g_debug ("Opening a new ConsoleKit session: XDG_SESSION_COOKIE=%s",
+ g_debug ("Opening a new ConsoleKit session: XDG_SESSION_COOKIE=%s",
manager->consolekit_cookie);
#endif
}
@@ -408,10 +408,10 @@ static void xfsm_manager_consolekit_cleanup (XfsmManager *manager)
{
GError *error = NULL;
gboolean ret, result;
-
+
if (manager->consolekit_proxy)
{
- if (manager->consolekit_cookie)
+ if (manager->consolekit_cookie)
{
ret = dbus_g_proxy_call (manager->consolekit_proxy, "CloseSession", &error,
G_TYPE_STRING, manager->consolekit_cookie,
@@ -665,14 +665,14 @@ xfsm_manager_load_session (XfsmManager *manager)
gchar buffer[1024];
XfceRc *rc;
gint count;
-
+
if (!g_file_test (manager->session_file, G_FILE_TEST_IS_REGULAR))
return FALSE;
rc = xfce_rc_simple_open (manager->session_file, FALSE);
if (G_UNLIKELY (rc == NULL))
return FALSE;
-
+
if (manager->session_chooser && !xfsm_manager_choose_session (manager, rc))
{
xfce_rc_close (rc);
@@ -680,7 +680,7 @@ xfsm_manager_load_session (XfsmManager *manager)
}
g_snprintf (buffer, 1024, "Session: %s", manager->session_name);
-
+
xfce_rc_set_group (rc, buffer);
count = xfce_rc_read_int_entry (rc, "Count", 0);
if (G_UNLIKELY (count <= 0))
@@ -688,7 +688,7 @@ xfsm_manager_load_session (XfsmManager *manager)
xfce_rc_close (rc);
return FALSE;
}
-
+
while (count-- > 0)
{
g_snprintf (buffer, 1024, "Client%d_", count);
@@ -801,7 +801,7 @@ xfsm_manager_load_settings (XfsmManager *manager,
XfconfChannel *channel)
{
gboolean session_loaded = FALSE;
-
+
manager->session_name = xfconf_channel_get_string (channel,
"/general/SessionName",
DEFAULT_SESSION_NAME);
@@ -900,7 +900,7 @@ xfsm_manager_restart (XfsmManager *manager)
g_object_unref (preview);
g_idle_add ((GSourceFunc) xfsm_manager_startup, manager);
-
+
return TRUE;
}
@@ -1044,7 +1044,7 @@ xfsm_manager_register_client (XfsmManager *manager,
g_signal_emit (manager, signals[SIG_CLIENT_REGISTERED], 0,
xfsm_client_get_object_path (client));
-
+
if (previous_id == NULL)
{
SmsSaveYourself (sms_conn, SmSaveLocal, False, SmInteractStyleNone, False);
@@ -1075,7 +1075,7 @@ xfsm_manager_start_interact (XfsmManager *manager,
/* notify client of interact */
SmsInteract (xfsm_client_get_sms_connection (client));
xfsm_client_set_state (client, XFSM_CLIENT_INTERACTING);
-
+
/* stop save yourself timeout */
xfsm_manager_cancel_client_save_timeout (manager, client);
}
@@ -1116,7 +1116,7 @@ xfsm_manager_interact (XfsmManager *manager,
return;
}
}
-
+
xfsm_manager_start_interact (manager, client);
}
}
@@ -1146,9 +1146,9 @@ xfsm_manager_interact_done (XfsmManager *manager,
xfsm_manager_close_connection (manager, client, TRUE);
return;
}
-
+
xfsm_client_set_state (client, XFSM_CLIENT_SAVING);
-
+
/* Setting the cancel-shutdown field to True indicates that the user
* has requested that the entire shutdown be cancelled. Cancel-
* shutdown may only be True if the corresponding SaveYourself
@@ -1160,7 +1160,7 @@ xfsm_manager_interact_done (XfsmManager *manager,
{
/* we go into checkpoint state from here... */
xfsm_manager_set_state (manager, XFSM_MANAGER_CHECKPOINT);
-
+
/* If a shutdown is in progress, the user may have the option
* of cancelling the shutdown. If the shutdown is cancelled
* (specified in the "Interact Done" message), the session
@@ -1295,7 +1295,7 @@ xfsm_manager_save_yourself_global (XfsmManager *manager,
shutdown
? XFSM_MANAGER_SHUTDOWN
: XFSM_MANAGER_CHECKPOINT);
-
+
/* handle legacy applications first! */
xfsm_legacy_perform_session_save ();
@@ -1321,7 +1321,7 @@ xfsm_manager_save_yourself_global (XfsmManager *manager,
xfsm_client_set_state (client, XFSM_CLIENT_SAVING);
xfsm_manager_start_client_save_timeout (manager, client);
- }
+ }
}
else
{
@@ -1356,7 +1356,7 @@ xfsm_manager_save_yourself (XfsmManager *manager,
xfsm_manager_close_connection (manager, client, TRUE);
return;
}
-
+
if (!global)
{
/* client requests a local checkpoint. We slightly ignore
@@ -1403,7 +1403,7 @@ xfsm_manager_save_yourself_done (XfsmManager *manager,
xfsm_verbose ("Client Id = %s send SAVE YOURSELF DONE, while not being "
"in save mode. Prepare to be nuked!\n",
xfsm_client_get_id (client));
-
+
xfsm_manager_close_connection (manager, client, TRUE);
}
@@ -1438,7 +1438,7 @@ xfsm_manager_close_connection (XfsmManager *manager,
{
IceConn ice_conn;
GList *lp;
-
+
xfsm_client_set_state (client, XFSM_CLIENT_DISCONNECTED);
xfsm_manager_cancel_client_save_timeout (manager, client);
@@ -1450,7 +1450,7 @@ xfsm_manager_close_connection (XfsmManager *manager,
IceSetShutdownNegotiation (ice_conn, False);
IceCloseConnection (ice_conn);
}
-
+
if (manager->state == XFSM_MANAGER_SHUTDOWNPHASE2)
{
for (lp = g_queue_peek_nth_link (manager->running_clients, 0);
@@ -1461,7 +1461,7 @@ xfsm_manager_close_connection (XfsmManager *manager,
if (xfsm_client_get_state (cl) != XFSM_CLIENT_DISCONNECTED)
return;
}
-
+
/* all clients finished the DIE phase in time */
if (manager->die_timeout_id)
{
@@ -1475,7 +1475,7 @@ xfsm_manager_close_connection (XfsmManager *manager,
xfsm_verbose ("Client Id = %s, closed connection in checkpoint state\n"
" Session manager will show NO MERCY\n\n",
xfsm_client_get_id (client));
-
+
/* stupid client disconnected in CheckPoint state, prepare to be nuked! */
g_queue_remove (manager->running_clients, client);
g_object_unref (client);
@@ -1484,7 +1484,7 @@ xfsm_manager_close_connection (XfsmManager *manager,
else
{
XfsmProperties *properties = xfsm_client_steal_properties (client);
-
+
if (properties != NULL)
{
if (xfsm_properties_check (properties))
@@ -1623,7 +1623,7 @@ xfsm_manager_check_clients_saving (XfsmManager *manager)
break;
}
}
-
+
return FALSE;
}
@@ -1633,13 +1633,13 @@ xfsm_manager_maybe_enter_phase2 (XfsmManager *manager)
{
gboolean entered_phase2 = FALSE;
GList *lp;
-
+
for (lp = g_queue_peek_nth_link (manager->running_clients, 0);
lp;
lp = lp->next)
- {
+ {
XfsmClient *client = lp->data;
-
+
if (xfsm_client_get_state (client) == XFSM_CLIENT_WAITFORPHASE2)
{
entered_phase2 = TRUE;
@@ -1666,12 +1666,12 @@ xfsm_manager_complete_saveyourself (XfsmManager *manager)
*/
if (xfsm_manager_check_clients_saving (manager) || xfsm_manager_maybe_enter_phase2 (manager))
return;
-
+
xfsm_verbose ("Manager finished SAVE YOURSELF, session data will be stored now.\n\n");
-
+
/* all clients done, store session data */
xfsm_manager_store_session (manager);
-
+
if (manager->state == XFSM_MANAGER_CHECKPOINT)
{
/* reset all clients to idle state */
@@ -1697,7 +1697,7 @@ static gboolean
xfsm_manager_save_timeout (gpointer user_data)
{
XfsmSaveTimeoutData *stdata = user_data;
-
+
xfsm_verbose ("Client id = %s, received SAVE TIMEOUT\n"
" Client will be disconnected now.\n\n",
xfsm_client_get_id (stdata->client));
@@ -1706,7 +1706,7 @@ xfsm_manager_save_timeout (gpointer user_data)
/* returning FALSE below will free the data */
g_object_steal_data (G_OBJECT (stdata->client), "--save-timeout-id");
-
+
return FALSE;
}
@@ -1809,7 +1809,7 @@ xfsm_manager_store_session (XfsmManager *manager)
SmRestartIfRunning);
if (restart_style_hint == SmRestartNever)
continue;
-
+
g_snprintf (prefix, 64, "Client%d_", count);
xfsm_properties_store (xfsm_client_get_properties (client), rc, prefix);
++count;
@@ -1826,7 +1826,7 @@ xfsm_manager_store_session (XfsmManager *manager)
{
screen = wnck_screen_get (n);
wnck_screen_force_update (screen);
-
+
workspace = wnck_screen_get_active_workspace (screen);
m = wnck_workspace_get_number (workspace);
diff --git a/xfce4-session/xfsm-manager.h b/xfce4-session/xfsm-manager.h
index 1a4ffcc..f83887c 100644
--- a/xfce4-session/xfsm-manager.h
+++ b/xfce4-session/xfsm-manager.h
@@ -8,12 +8,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
diff --git a/xfce4-session/xfsm-properties.c b/xfce4-session/xfsm-properties.c
index 45243dd..22c3688 100644
--- a/xfce4-session/xfsm-properties.c
+++ b/xfce4-session/xfsm-properties.c
@@ -8,12 +8,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -121,17 +121,17 @@ strv_to_property (const gchar *name,
{
SmProp *prop;
gint argc;
-
+
prop = (SmProp *) malloc (sizeof (*prop));
prop->name = strdup (name);
prop->type = strdup (SmLISTofARRAY8);
-
+
for (argc = 0; argv[argc] != NULL; ++argc)
;
-
+
prop->num_vals = argc;
prop->vals = (SmPropValue *) malloc (argc * sizeof (SmPropValue));
-
+
while (argc-- > 0)
{
prop->vals[argc].length = strlen (argv[argc]) + 1;
@@ -147,7 +147,7 @@ str_to_property (const gchar *name,
const gchar *value)
{
SmProp *prop;
-
+
prop = (SmProp *) malloc (sizeof (*prop));
prop->name = strdup (name);
prop->type = strdup (SmARRAY8);
@@ -155,7 +155,7 @@ str_to_property (const gchar *name,
prop->vals = (SmPropValue *) malloc (sizeof (SmPropValue));
prop->vals[0].length = strlen (value) + 1;
prop->vals[0].value = strdup (value);
-
+
return prop;
}
@@ -166,10 +166,10 @@ int_to_property (const gchar *name,
{
SmProp *prop;
gint8 *p;
-
+
p = (gint8 *) malloc (1);
p[0] = (gint8) value;
-
+
prop = (SmProp *) malloc (sizeof (*prop));
prop->name = strdup (name);
prop->type = strdup (SmCARD8);
@@ -177,7 +177,7 @@ int_to_property (const gchar *name,
prop->vals = (SmPropValue *) malloc (sizeof (SmPropValue));
prop->vals[0].length = 1;
prop->vals[0].value = p;
-
+
return prop;
}
@@ -187,7 +187,7 @@ xfsm_properties_new (const gchar *client_id,
const gchar *hostname)
{
XfsmProperties *properties;
-
+
properties = g_slice_new0 (XfsmProperties);
properties->client_id = g_strdup (client_id);
properties->hostname = g_strdup (hostname);
@@ -197,7 +197,7 @@ xfsm_properties_new (const gchar *client_id,
NULL,
(GDestroyNotify) g_free,
(GDestroyNotify) xfsm_g_value_free);
-
+
return properties;
}
@@ -231,16 +231,16 @@ xfsm_properties_extract (XfsmProperties *properties,
SmProp ***props)
{
SmProp **pp;
-
+
g_return_if_fail (num_props != NULL);
g_return_if_fail (props != NULL);
-
+
*props = pp = (SmProp **) malloc (sizeof (SmProp *) * g_tree_nnodes (properties->sm_properties));
g_tree_foreach (properties->sm_properties,
xfsm_properties_extract_foreach,
&pp);
-
+
*num_props = pp - *props;
}
@@ -278,7 +278,7 @@ xfsm_properties_load (XfceRc *rc,
}
xfsm_verbose ("Loading properties for client %s\n", client_id);
-
+
properties = xfsm_properties_new (client_id, hostname);
for (i = 0; strv_properties[i].name; ++i)
@@ -317,7 +317,7 @@ xfsm_properties_load (XfceRc *rc,
}
return properties;
-
+
#undef ENTRY
}
@@ -332,7 +332,7 @@ xfsm_properties_store (XfsmProperties *properties,
GValue *value;
gint i;
gchar buffer[256];
-
+
xfce_rc_write_entry (rc, ENTRY ("ClientId"), properties->client_id);
xfce_rc_write_entry (rc, ENTRY ("Hostname"), properties->hostname);
@@ -401,7 +401,7 @@ gboolean
xfsm_properties_check (const XfsmProperties *properties)
{
g_return_val_if_fail (properties != NULL, FALSE);
-
+
return properties->client_id != NULL
&& properties->hostname != NULL
&& g_tree_lookup (properties->sm_properties, SmProgram) != NULL
diff --git a/xfce4-session/xfsm-properties.h b/xfce4-session/xfsm-properties.h
index f3fd8d3..46e4353 100644
--- a/xfce4-session/xfsm-properties.h
+++ b/xfce4-session/xfsm-properties.h
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -38,7 +38,7 @@ struct _XfsmProperties
{
guint restart_attempts;
guint restart_attempts_reset_id;
-
+
guint startup_timeout_id;
GPid pid;
diff --git a/xfce4-session/xfsm-shutdown-helper.c b/xfce4-session/xfsm-shutdown-helper.c
index b88e07b..f5d6bf8 100644
--- a/xfce4-session/xfsm-shutdown-helper.c
+++ b/xfce4-session/xfsm-shutdown-helper.c
@@ -8,12 +8,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -69,14 +69,14 @@
static void xfsm_shutdown_helper_finalize (GObject *object);
static void xfsm_shutdown_helper_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec);
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec);
static void xfsm_shutdown_helper_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec);
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec);
/**
* Suspend/Hibernate backend to use.
@@ -90,7 +90,7 @@ typedef enum
XFSM_SLEEP_BACKEND_UPOWER,
XFSM_SLEEP_BACKEND_HAL,
XFSM_SLEEP_BACKEND_SUDO /*sudo pm-suspend ?*/
-
+
} XfsmSleepBackend;
/**
@@ -129,7 +129,7 @@ struct _XfsmShutdownHelper
XfsmShutdownBackend shutdown_backend;
XfsmSleepBackend sleep_backend;
-
+
gboolean auth_shutdown;
gboolean auth_restart;
gboolean auth_suspend;
@@ -274,8 +274,8 @@ get_start_time_for_pid (pid_t pid)
if (! get_kinfo_proc (pid, &p))
{
g_warning ("Error obtaining start time for %d (%s)",
- (gint) pid,
- g_strerror (errno));
+ (gint) pid,
+ g_strerror (errno));
goto out;
}
@@ -292,32 +292,32 @@ init_dbus_gtypes (void)
{
if (G_UNLIKELY (polkit_subject_gtype == G_TYPE_INVALID ) )
{
- polkit_subject_gtype =
- dbus_g_type_get_struct ("GValueArray",
- G_TYPE_STRING,
- dbus_g_type_get_map ("GHashTable",
- G_TYPE_STRING,
- G_TYPE_VALUE),
- G_TYPE_INVALID);
+ polkit_subject_gtype =
+ dbus_g_type_get_struct ("GValueArray",
+ G_TYPE_STRING,
+ dbus_g_type_get_map ("GHashTable",
+ G_TYPE_STRING,
+ G_TYPE_VALUE),
+ G_TYPE_INVALID);
}
-
- if (G_UNLIKELY (polkit_details_gtype == G_TYPE_INVALID ) )
+
+ if (G_UNLIKELY (polkit_details_gtype == G_TYPE_INVALID ))
{
- polkit_details_gtype = dbus_g_type_get_map ("GHashTable",
- G_TYPE_STRING,
- G_TYPE_STRING);
+ polkit_details_gtype = dbus_g_type_get_map ("GHashTable",
+ G_TYPE_STRING,
+ G_TYPE_STRING);
}
- if ( G_UNLIKELY (polkit_result_gtype == G_TYPE_INVALID ) )
+ if (G_UNLIKELY (polkit_result_gtype == G_TYPE_INVALID ) )
{
polkit_result_gtype =
- dbus_g_type_get_struct ("GValueArray",
- G_TYPE_BOOLEAN,
- G_TYPE_BOOLEAN,
- dbus_g_type_get_map ("GHashTable",
- G_TYPE_STRING,
- G_TYPE_STRING),
- G_TYPE_INVALID);
+ dbus_g_type_get_struct ("GValueArray",
+ G_TYPE_BOOLEAN,
+ G_TYPE_BOOLEAN,
+ dbus_g_type_get_map ("GHashTable",
+ G_TYPE_STRING,
+ G_TYPE_STRING),
+ G_TYPE_INVALID);
}
}
@@ -334,127 +334,124 @@ xfsm_shutdown_helper_init_polkit_data (XfsmShutdownHelper *helper)
const gchar *consolekit_cookie;
GValue hash_elem = { 0 };
gboolean subject_created = FALSE;
-
- helper->polkit_proxy =
+
+ helper->polkit_proxy =
dbus_g_proxy_new_for_name (helper->system_bus,
- "org.freedesktop.PolicyKit1",
- "/org/freedesktop/PolicyKit1/Authority",
- "org.freedesktop.PolicyKit1.Authority");
-
- if ( !helper->polkit_proxy )
+ "org.freedesktop.PolicyKit1",
+ "/org/freedesktop/PolicyKit1/Authority",
+ "org.freedesktop.PolicyKit1.Authority");
+
+ if (!helper->polkit_proxy)
return FALSE;
/**
- * This variable should be set by the session manager or by
+ * This variable should be set by the session manager or by
* the login manager (gdm?). under clean Xfce environment
- * it is set by the session manager (4.8 and above)
+ * it is set by the session manager (4.8 and above)
* since we don't have a login manager, yet!
**/
consolekit_cookie = g_getenv ("XDG_SESSION_COOKIE");
-
- if ( consolekit_cookie )
+
+ if (consolekit_cookie)
{
DBusGProxy *proxy;
GError *error = NULL;
gboolean ret;
gchar *consolekit_session;
-
+
proxy = dbus_g_proxy_new_for_name (helper->system_bus,
- "org.freedesktop.ConsoleKit",
- "/org/freedesktop/ConsoleKit/Manager",
- "org.freedesktop.ConsoleKit.Manager");
-
- if ( proxy )
- {
- ret = dbus_g_proxy_call (proxy, "GetSessionForCookie", &error,
- G_TYPE_STRING, consolekit_cookie,
- G_TYPE_INVALID,
- DBUS_TYPE_G_OBJECT_PATH, &consolekit_session,
- G_TYPE_INVALID);
-
- if ( G_LIKELY (ret) )
- {
- GValue val = { 0 };
- helper->polkit_subject = g_value_array_new (2);
- helper->polkit_subject_hash = g_hash_table_new_full (g_str_hash,
- g_str_equal,
- g_free,
- NULL);
-
- g_value_init (&val, G_TYPE_STRING);
- g_value_set_string (&val, "unix-session");
- g_value_array_append (helper->polkit_subject, &val);
-
- g_value_unset (&val);
- g_value_init (&val, G_TYPE_STRING);
- g_value_set_string (&val, consolekit_session);
-
- g_hash_table_insert (helper->polkit_subject_hash, g_strdup ("session-id"), &val);
-
- g_free (consolekit_session);
- subject_created = TRUE;
- }
- else if (error)
- {
- g_warning ("'GetSessionForCookie' failed : %s", error->message);
- g_error_free (error);
- }
- g_object_unref (proxy);
- }
- }
-
+ "org.freedesktop.ConsoleKit",
+ "/org/freedesktop/ConsoleKit/Manager",
+ "org.freedesktop.ConsoleKit.Manager");
+
+ if (proxy)
+ {
+ ret = dbus_g_proxy_call (proxy, "GetSessionForCookie", &error,
+ G_TYPE_STRING, consolekit_cookie,
+ G_TYPE_INVALID,
+ DBUS_TYPE_G_OBJECT_PATH, &consolekit_session,
+ G_TYPE_INVALID);
+
+ if (G_LIKELY (ret))
+ {
+ GValue val = { 0 };
+
+ helper->polkit_subject = g_value_array_new (2);
+ helper->polkit_subject_hash = g_hash_table_new_full (g_str_hash,
+ g_str_equal,
+ g_free, NULL);
+ g_value_init (&val, G_TYPE_STRING);
+ g_value_set_string (&val, "unix-session");
+ g_value_array_append (helper->polkit_subject, &val);
+
+ g_value_unset (&val);
+ g_value_init (&val, G_TYPE_STRING);
+ g_value_set_string (&val, consolekit_session);
+
+ g_hash_table_insert (helper->polkit_subject_hash, g_strdup ("session-id"), &val);
+
+ g_free (consolekit_session);
+ subject_created = TRUE;
+ }
+ else if (error)
+ {
+ g_warning ("'GetSessionForCookie' failed : %s", error->message);
+ g_error_free (error);
+ }
+ g_object_unref (proxy);
+ }
+ }
+
/**
* We failed to get valid session data, then we try
* to check authentication using the pid.
**/
- if ( subject_created == FALSE )
+ if (subject_created == FALSE)
{
gint pid;
guint64 start_time;
pid = getpid ();
-
+
start_time = get_start_time_for_pid (pid);
- if ( G_LIKELY (start_time != 0 ) )
- {
- GValue val = { 0 }, pid_val = { 0 }, start_time_val = { 0 };
-
- helper->polkit_subject = g_value_array_new (2);
- helper->polkit_subject_hash = g_hash_table_new_full (g_str_hash,
- g_str_equal,
- g_free,
- NULL);
-
- g_value_init (&val, G_TYPE_STRING);
- g_value_set_string (&val, "unix-process");
- g_value_array_append (helper->polkit_subject, &val);
-
- g_value_unset (&val);
-
- g_value_init (&pid_val, G_TYPE_UINT);
- g_value_set_uint (&pid_val, pid);
- g_hash_table_insert (helper->polkit_subject_hash, g_strdup ("pid"), &pid_val);
-
- g_value_init (&start_time_val, G_TYPE_UINT64);
- g_value_set_uint64 (&start_time_val, start_time);
- g_hash_table_insert (helper->polkit_subject_hash, g_strdup ("start-time"), &start_time_val);
- }
+ if (G_LIKELY (start_time != 0))
+ {
+ GValue val = { 0 }, pid_val = { 0 }, start_time_val = { 0 };
+
+ helper->polkit_subject = g_value_array_new (2);
+ helper->polkit_subject_hash = g_hash_table_new_full (g_str_hash,
+ g_str_equal,
+ g_free, NULL);
+ g_value_init (&val, G_TYPE_STRING);
+ g_value_set_string (&val, "unix-process");
+ g_value_array_append (helper->polkit_subject, &val);
+
+ g_value_unset (&val);
+
+ g_value_init (&pid_val, G_TYPE_UINT);
+ g_value_set_uint (&pid_val, pid);
+ g_hash_table_insert (helper->polkit_subject_hash, g_strdup ("pid"), &pid_val);
+
+ g_value_init (&start_time_val, G_TYPE_UINT64);
+ g_value_set_uint64 (&start_time_val, start_time);
+ g_hash_table_insert (helper->polkit_subject_hash, g_strdup ("start-time"), &start_time_val);
+ }
else
- {
- g_warning ("Unable to create Polkit subject");
- return FALSE;
- }
+ {
+ g_warning ("Unable to create Polkit subject");
+ return FALSE;
+ }
}
- g_value_init (&hash_elem,
- dbus_g_type_get_map ("GHashTable",
- G_TYPE_STRING,
- G_TYPE_VALUE));
-
+ g_value_init (&hash_elem,
+ dbus_g_type_get_map ("GHashTable",
+ G_TYPE_STRING,
+ G_TYPE_VALUE));
+
g_value_set_static_boxed (&hash_elem, helper->polkit_subject_hash);
g_value_array_append (helper->polkit_subject, &hash_elem);
-
+
/**
* Polkit details, will leave it empty.
**/
@@ -466,11 +463,11 @@ xfsm_shutdown_helper_init_polkit_data (XfsmShutdownHelper *helper)
/**
* xfsm_shutdown_helper_check_sudo:
- *
+ *
* Check if we can use sudo backend.
* Method is called if HAL, upower, consolekit are missing
* or the session was compiled without those services.
- *
+ *
**/
static gboolean
xfsm_shutdown_helper_check_sudo (XfsmShutdownHelper *helper)
@@ -481,17 +478,17 @@ xfsm_shutdown_helper_check_sudo (XfsmShutdownHelper *helper)
gint child_pipe[2];
gint result;
gint n;
-
+
helper->sudo = g_find_program_in_path ("sudo");
-
+
if ( G_UNLIKELY (helper->sudo == NULL ) )
{
g_warning ("Program 'sudo' was not found.");
return FALSE;
}
-
+
result = pipe (parent_pipe);
-
+
if (result < 0)
{
g_warning ("Unable to create parent pipe: %s", strerror (errno));
@@ -506,7 +503,7 @@ xfsm_shutdown_helper_check_sudo (XfsmShutdownHelper *helper)
}
helper->pid = fork ();
-
+
if (helper->pid < 0)
{
g_warning ("Unable to fork sudo helper: %s", strerror (errno));
@@ -540,20 +537,20 @@ xfsm_shutdown_helper_check_sudo (XfsmShutdownHelper *helper)
"XFSM_SUDO_PASS ", "--", XFSM_SHUTDOWN_HELPER_CMD, NULL);
_exit (127);
}
-
+
close (parent_pipe[1]);
-
+
/* read sudo/helper answer */
n = read (parent_pipe[0], buf, 15);
if (n < 15)
{
g_warning ("Unable to read response from sudo helper: %s",
- n < 0 ? strerror (errno) : "Unknown error");
+ n < 0 ? strerror (errno) : "Unknown error");
goto error1;
}
helper->infile = fdopen (parent_pipe[0], "r");
-
+
if (helper->infile == NULL)
{
g_warning ("Unable to open parent pipe: %s", strerror (errno));
@@ -593,7 +590,7 @@ error2:
fclose (helper->infile);
helper->infile = NULL;
}
-
+
if (helper->outfile != NULL)
{
fclose (helper->outfile);
@@ -617,10 +614,10 @@ error0:
*
**/
static GHashTable *
-xfsm_shutdown_helper_get_power_props (XfsmShutdownHelper *helper,
- const gchar *name,
- const gchar *path,
- const gchar *iface)
+xfsm_shutdown_helper_get_power_props (XfsmShutdownHelper *helper,
+ const gchar *name,
+ const gchar *path,
+ const gchar *iface)
{
DBusGProxy *proxy_prop;
GHashTable *props;
@@ -628,11 +625,11 @@ xfsm_shutdown_helper_get_power_props (XfsmShutdownHelper *helper,
GError *error = NULL;
proxy_prop = dbus_g_proxy_new_for_name (helper->system_bus,
- name,
- path,
- DBUS_INTERFACE_PROPERTIES);
+ name,
+ path,
+ DBUS_INTERFACE_PROPERTIES);
- if ( !proxy_prop )
+ if (!proxy_prop)
{
g_warning ("Unable to create proxy for %s", name);
return NULL;
@@ -642,14 +639,14 @@ xfsm_shutdown_helper_get_power_props (XfsmShutdownHelper *helper,
g_type_hash_map = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE);
dbus_g_proxy_call (proxy_prop, "GetAll", &error,
- G_TYPE_STRING, iface,
- G_TYPE_INVALID,
- g_type_hash_map, &props,
- G_TYPE_INVALID);
+ G_TYPE_STRING, iface,
+ G_TYPE_INVALID,
+ g_type_hash_map, &props,
+ G_TYPE_INVALID);
g_object_unref (proxy_prop);
- if ( error )
+ if (error)
{
g_warning ("Method 'GetAll' failed : %s", error->message);
g_error_free (error);
@@ -662,10 +659,10 @@ xfsm_shutdown_helper_get_power_props (XfsmShutdownHelper *helper,
/**
* xfsm_shutdown_helper_check_devkit_upower:
- *
+ *
* Check upower (formely devicekit-power)
* for hibernate and suspend availability.
- *
+ *
* Returns: FALSE if failed to contact upower, TRUE otherwise.
**/
static gboolean
@@ -687,7 +684,7 @@ xfsm_shutdown_helper_check_devkit_upower (XfsmShutdownHelper *helper)
GHashTable *props;
GValue *value;
const gchar *name, *path, *iface;
-
+
/* Check for upower first */
name = "org.freedesktop.UPower";
path = "/org/freedesktop/UPower";
@@ -696,10 +693,10 @@ xfsm_shutdown_helper_check_devkit_upower (XfsmShutdownHelper *helper)
helper->devkit_is_upower = TRUE;
props = xfsm_shutdown_helper_get_power_props (helper,
- name,
- path,
- iface);
- if ( !props )
+ name,
+ path,
+ iface);
+ if (!props)
{
g_message ("UPower not found, trying DevKitPower");
@@ -710,20 +707,20 @@ xfsm_shutdown_helper_check_devkit_upower (XfsmShutdownHelper *helper)
helper->devkit_is_upower = FALSE;
props = xfsm_shutdown_helper_get_power_props (helper,
- name,
- path,
- iface);
+ name,
+ path,
+ iface);
if (!props)
- {
- g_message ("Devkit Power is not running or not installed");
- return FALSE;
- }
+ {
+ g_message ("Devkit Power is not running or not installed");
+ return FALSE;
+ }
}
-
+
/*Get The CanSuspend bit*/
value = g_hash_table_lookup (props, "CanSuspend");
-
- if ( G_LIKELY (value) )
+
+ if (G_LIKELY (value))
{
helper->can_suspend = g_value_get_boolean (value);
}
@@ -731,11 +728,11 @@ xfsm_shutdown_helper_check_devkit_upower (XfsmShutdownHelper *helper)
{
g_warning ("No 'CanSuspend' property");
}
-
+
/*Get the CanHibernate bit*/
value = g_hash_table_lookup (props, "CanHibernate");
-
- if ( G_LIKELY (value) )
+
+ if (G_LIKELY (value))
{
helper->can_hibernate = g_value_get_boolean (value);
}
@@ -743,7 +740,7 @@ xfsm_shutdown_helper_check_devkit_upower (XfsmShutdownHelper *helper)
{
g_warning ("No 'CanHibernate' property");
}
-
+
g_hash_table_destroy (props);
return TRUE;
@@ -766,10 +763,9 @@ xfsm_shutdown_helper_check_console_kit (XfsmShutdownHelper *helper)
gboolean ret;
proxy = dbus_g_proxy_new_for_name (helper->system_bus,
- "org.freedesktop.ConsoleKit",
- "/org/freedesktop/ConsoleKit/Manager",
- "org.freedesktop.ConsoleKit.Manager");
-
+ "org.freedesktop.ConsoleKit",
+ "/org/freedesktop/ConsoleKit/Manager",
+ "org.freedesktop.ConsoleKit.Manager");
if (!proxy)
{
@@ -778,29 +774,29 @@ xfsm_shutdown_helper_check_console_kit (XfsmShutdownHelper *helper)
}
ret = dbus_g_proxy_call (proxy, "CanStop", &error,
- G_TYPE_INVALID,
- G_TYPE_BOOLEAN, &helper->can_shutdown,
- G_TYPE_INVALID);
-
- if ( error )
+ G_TYPE_INVALID,
+ G_TYPE_BOOLEAN, &helper->can_shutdown,
+ G_TYPE_INVALID);
+
+ if (error)
{
g_warning ("'CanStop' method failed : %s", error->message);
g_error_free (error);
goto out;
}
-
+
dbus_g_proxy_call (proxy, "CanRestart", &error,
- G_TYPE_INVALID,
- G_TYPE_BOOLEAN, &helper->can_restart,
- G_TYPE_INVALID);
-
- if ( error )
+ G_TYPE_INVALID,
+ G_TYPE_BOOLEAN, &helper->can_restart,
+ G_TYPE_INVALID);
+
+ if (error)
{
g_warning ("'CanRestart' method failed : %s", error->message);
g_error_free (error);
goto out;
}
-
+
ret = TRUE;
out:
@@ -816,7 +812,7 @@ xfsm_shutdown_helper_check_console_kit (XfsmShutdownHelper *helper)
* xfsm_shutdown_helper_check_hal:
*
* Check if HAL is running and for its PowerManagement bits
- *
+ *
**/
#ifdef ENABLE_HAL
static gboolean
@@ -827,32 +823,33 @@ xfsm_shutdown_helper_check_hal (XfsmShutdownHelper *helper)
GError *error = NULL;
gboolean ret = FALSE;
- proxy_power =
+ proxy_power =
dbus_g_proxy_new_for_name (helper->system_bus,
- "org.freedesktop.Hal",
- "/org/freedesktop/Hal/devices/computer",
- "org.freedesktop.Hal.Device.SystemPowerManagement");
-
+ "org.freedesktop.Hal",
+ "/org/freedesktop/Hal/devices/computer",
+ "org.freedesktop.Hal.Device.SystemPowerManagement");
+
if (!proxy_power)
{
g_warning ("Failed to create proxy for 'org.freedesktop.Hal' ");
return FALSE;
}
-
+
dbus_g_proxy_call (proxy_power, "JustToCheckUserPermission", &error,
- G_TYPE_INVALID,
- G_TYPE_INVALID);
-
+ G_TYPE_INVALID,
+ G_TYPE_INVALID);
+
g_object_unref (proxy_power);
- if ( G_LIKELY (error) )
+ if (G_LIKELY (error))
{
/* The message passed dbus permission check? */
if ( !g_error_matches (error, DBUS_GERROR, DBUS_GERROR_UNKNOWN_METHOD) )
- {
- g_error_free (error);
- return FALSE;
- }
+ {
+ g_error_free (error);
+ return FALSE;
+ }
+
g_error_free (error);
error = NULL;
}
@@ -877,21 +874,20 @@ xfsm_shutdown_helper_check_hal (XfsmShutdownHelper *helper)
/*Check to see is the system can_hibernate and can_suspend*/
proxy_device = dbus_g_proxy_new_for_name (helper->system_bus,
- "org.freedesktop.Hal",
- "/org/freedesktop/Hal/devices/computer",
- "org.freedesktop.Hal.Device");
-
+ "org.freedesktop.Hal",
+ "/org/freedesktop/Hal/devices/computer",
+ "org.freedesktop.Hal.Device");
- if ( !proxy_device )
- return FALSE;
+ if (!proxy_device)
+ return FALSE;
dbus_g_proxy_call (proxy_device, "GetPropertyBoolean", &error,
- G_TYPE_STRING, "power_management.can_hibernate",
- G_TYPE_INVALID,
- G_TYPE_BOOLEAN, &helper->can_hibernate,
- G_TYPE_INVALID);
+ G_TYPE_STRING, "power_management.can_hibernate",
+ G_TYPE_INVALID,
+ G_TYPE_BOOLEAN, &helper->can_hibernate,
+ G_TYPE_INVALID);
- if ( error )
+ if (error)
{
g_warning ("Method 'GetPropertyBoolean' failed : %s", error->message);
g_error_free (error);
@@ -899,12 +895,12 @@ xfsm_shutdown_helper_check_hal (XfsmShutdownHelper *helper)
}
dbus_g_proxy_call (proxy_device, "GetPropertyBoolean", &error,
- G_TYPE_STRING, "power_management.can_suspend",
- G_TYPE_INVALID,
- G_TYPE_BOOLEAN, &helper->can_suspend,
- G_TYPE_INVALID);
-
- if ( error )
+ G_TYPE_STRING, "power_management.can_suspend",
+ G_TYPE_INVALID,
+ G_TYPE_BOOLEAN, &helper->can_suspend,
+ G_TYPE_INVALID);
+
+ if (error)
{
g_warning ("Method 'GetPropertyBoolean' failed : %s", error->message);
g_error_free (error);
@@ -914,9 +910,9 @@ xfsm_shutdown_helper_check_hal (XfsmShutdownHelper *helper)
ret = TRUE;
out:
-
+
g_object_unref (proxy_device);
-
+
return ret;
}
#endif /*ENABLE_HAL*/
@@ -924,27 +920,26 @@ xfsm_shutdown_helper_check_hal (XfsmShutdownHelper *helper)
/**
* xfsm_shutdown_helper_check_polkit_authorization:
*
- *
**/
#ifdef ENABLE_POLKIT
static gboolean
xfsm_shutdown_helper_check_authorization (XfsmShutdownHelper *helper,
- const gchar *action_id)
+ const gchar *action_id)
{
GValueArray *result;
GValue result_val = { 0 };
GError *error = NULL;
gboolean is_authorized = FALSE;
gboolean ret;
-
+
/**
- * <method name="CheckAuthorization">
- * <arg type="(sa{sv})" name="subject" direction="in"/>
- * <arg type="s" name="action_id" direction="in"/>
- * <arg type="a{ss}" name="details" direction="in"/>
- * <arg type="u" name="flags" direction="in"/>
- * <arg type="s" name="cancellation_id" direction="in"/>
- * <arg type="(bba{ss})" name="result" direction="out"/>
+ * <method name="CheckAuthorization">
+ * <arg type="(sa{sv})" name="subject" direction="in"/>
+ * <arg type="s" name="action_id" direction="in"/>
+ * <arg type="a{ss}" name="details" direction="in"/>
+ * <arg type="u" name="flags" direction="in"/>
+ * <arg type="s" name="cancellation_id" direction="in"/>
+ * <arg type="(bba{ss})" name="result" direction="out"/>
* </method>
*
**/
@@ -957,32 +952,31 @@ xfsm_shutdown_helper_check_authorization (XfsmShutdownHelper *helper,
init_dbus_gtypes ();
result = g_value_array_new (0);
-
+
ret = dbus_g_proxy_call (helper->polkit_proxy, "CheckAuthorization", &error,
- polkit_subject_gtype, helper->polkit_subject,
- G_TYPE_STRING, action_id,
- polkit_details_gtype, helper->polkit_details,
- G_TYPE_UINT, 0,
- G_TYPE_STRING, NULL,
- G_TYPE_INVALID,
- polkit_result_gtype, &result,
- G_TYPE_INVALID);
+ polkit_subject_gtype, helper->polkit_subject,
+ G_TYPE_STRING, action_id,
+ polkit_details_gtype, helper->polkit_details,
+ G_TYPE_UINT, 0,
+ G_TYPE_STRING, NULL,
+ G_TYPE_INVALID,
+ polkit_result_gtype, &result,
+ G_TYPE_INVALID);
- if ( G_LIKELY (ret) )
+ if (G_LIKELY (ret))
{
g_value_init (&result_val, polkit_result_gtype);
g_value_set_static_boxed (&result_val, result);
dbus_g_type_struct_get (&result_val,
- 0, &is_authorized,
- G_MAXUINT);
+ 0, &is_authorized,
+ G_MAXUINT);
g_value_unset (&result_val);
}
- else if ( error )
+ else if (error)
{
g_warning ("'CheckAuthorization' failed : %s", error->message);
g_error_free (error);
-
}
g_value_array_free (result);
@@ -992,7 +986,7 @@ xfsm_shutdown_helper_check_authorization (XfsmShutdownHelper *helper,
/**
*xfsm_shutdown_helper_check_backends:
- *
+ *
* Try to check what is the best available backend to use
* Supported: ConsoleKit, HAL, upower and sudo.
*
@@ -1024,103 +1018,102 @@ xfsm_shutdown_helper_check_backends (XfsmShutdownHelper *helper)
if ( helper->sleep_backend == XFSM_SLEEP_BACKEND_UPOWER )
{
#ifdef ENABLE_POLKIT
-
+
polkit_ok = xfsm_shutdown_helper_init_polkit_data (helper);
-
- if ( polkit_ok )
- {
- const gchar *action_hibernate, *action_suspend;
-
- if ( helper->devkit_is_upower )
- {
- action_hibernate = "org.freedesktop.upower.hibernate";
- action_suspend = "org.freedesktop.upower.suspend";
- }
- else
- {
- action_hibernate = "org.freedesktop.devicekit.power.hibernate";
- action_suspend = "org.freedesktop.devicekit.power.suspend";
- }
-
- helper->auth_hibernate =
- xfsm_shutdown_helper_check_authorization (helper,
- action_hibernate);
- helper->auth_suspend =
- xfsm_shutdown_helper_check_authorization (helper,
- action_suspend);
- }
+
+ if (polkit_ok)
+ {
+ const gchar *action_hibernate, *action_suspend;
+
+ if (helper->devkit_is_upower)
+ {
+ action_hibernate = "org.freedesktop.upower.hibernate";
+ action_suspend = "org.freedesktop.upower.suspend";
+ }
+ else
+ {
+ action_hibernate = "org.freedesktop.devicekit.power.hibernate";
+ action_suspend = "org.freedesktop.devicekit.power.suspend";
+ }
+
+ helper->auth_hibernate =
+ xfsm_shutdown_helper_check_authorization (helper, action_hibernate);
+
+ helper->auth_suspend =
+ xfsm_shutdown_helper_check_authorization (helper, action_suspend);
+ }
else
- {
- helper->auth_hibernate = TRUE;
- helper->auth_suspend = TRUE;
- }
+ {
+ helper->auth_hibernate = TRUE;
+ helper->auth_suspend = TRUE;
+ }
#else
helper->auth_hibernate = TRUE;
helper->auth_suspend = TRUE;
#endif /* ENABLE_POLKIT */
}
- /*
+ /*
* Use HAL just as a fallback.
*/
#ifdef ENABLE_HAL
- if ( helper->sleep_backend == XFSM_SLEEP_BACKEND_NOT_SUPPORTED ||
- helper->shutdown_backend == XFSM_SHUTDOWN_BACKEND_NOT_SUPPORTED )
- {
- if ( xfsm_shutdown_helper_check_hal (helper) )
- {
- if ( helper->shutdown_backend == XFSM_SHUTDOWN_BACKEND_NOT_SUPPORTED )
- helper->shutdown_backend = XFSM_SHUTDOWN_BACKEND_HAL;
-
- if ( helper->sleep_backend == XFSM_SLEEP_BACKEND_NOT_SUPPORTED )
- helper->sleep_backend = XFSM_SLEEP_BACKEND_HAL;
- }
+ if (helper->sleep_backend == XFSM_SLEEP_BACKEND_NOT_SUPPORTED ||
+ helper->shutdown_backend == XFSM_SHUTDOWN_BACKEND_NOT_SUPPORTED)
+ {
+ if (xfsm_shutdown_helper_check_hal (helper))
+ {
+ if (helper->shutdown_backend == XFSM_SHUTDOWN_BACKEND_NOT_SUPPORTED)
+ helper->shutdown_backend = XFSM_SHUTDOWN_BACKEND_HAL;
+
+ if (helper->sleep_backend == XFSM_SLEEP_BACKEND_NOT_SUPPORTED)
+ helper->sleep_backend = XFSM_SLEEP_BACKEND_HAL;
+ }
}
#endif
/* Fallback for sudo */
- if ( helper->shutdown_backend == XFSM_SHUTDOWN_BACKEND_NOT_SUPPORTED )
+ if (helper->shutdown_backend == XFSM_SHUTDOWN_BACKEND_NOT_SUPPORTED)
{
if (xfsm_shutdown_helper_check_sudo (helper) )
- {
- helper->shutdown_backend = XFSM_SHUTDOWN_BACKEND_SUDO;
- helper->can_shutdown = TRUE;
- helper->can_restart = TRUE;
- helper->auth_shutdown = TRUE;
- helper->auth_restart = TRUE;
- }
+ {
+ helper->shutdown_backend = XFSM_SHUTDOWN_BACKEND_SUDO;
+ helper->can_shutdown = TRUE;
+ helper->can_restart = TRUE;
+ helper->auth_shutdown = TRUE;
+ helper->auth_restart = TRUE;
+ }
}
#ifdef DEBUG
{
const gchar *shutdown_str[] = {"Shutdown not supported",
- "Using ConsoleKit for shutdown",
- "Using HAL for shutdown",
- "Using Sudo for shutdown",
- NULL};
-
+ "Using ConsoleKit for shutdown",
+ "Using HAL for shutdown",
+ "Using Sudo for shutdown",
+ NULL};
+
const gchar *sleep_str[] = {"Sleep not supported",
- "Using UPower for sleep",
- "Using HAL for sleep",
- "Using Sudo for sleep",
- NULL};
+ "Using UPower for sleep",
+ "Using HAL for sleep",
+ "Using Sudo for sleep",
+ NULL};
g_debug ("%s", shutdown_str[helper->shutdown_backend]);
g_debug ("%s", sleep_str[helper->sleep_backend]);
g_debug ("can_shutdown=%d can_restart=%d can_hibernate=%d can_suspend=%d",
- helper->can_shutdown, helper->can_restart,
- helper->can_hibernate, helper->can_suspend);
-
+ helper->can_shutdown, helper->can_restart,
+ helper->can_hibernate, helper->can_suspend);
+
g_debug ("auth_shutdown=%d auth_restart=%d auth_hibernate=%d auth_suspend=%d",
- helper->auth_shutdown, helper->auth_restart,
- helper->auth_hibernate, helper->auth_suspend);
+ helper->auth_shutdown, helper->auth_restart,
+ helper->auth_hibernate, helper->auth_suspend);
}
#endif
#ifdef ENABLE_POLKIT
- if ( polkit_ok )
+ if (polkit_ok)
{
g_hash_table_destroy (helper->polkit_details);
g_hash_table_destroy (helper->polkit_subject_hash);
@@ -1135,166 +1128,165 @@ static void
xfsm_shutdown_helper_class_init (XfsmShutdownHelperClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
+
object_class->finalize = xfsm_shutdown_helper_finalize;
-
+
object_class->get_property = xfsm_shutdown_helper_get_property;
object_class->set_property = xfsm_shutdown_helper_set_property;
/**
* XfsmShutdownHelper::authorized-to-shutdown
- *
+ *
* Whether the user is allowed to preform shutdown.
**/
g_object_class_install_property (object_class,
- PROP_AUTHORIZED_TO_SHUTDOWN,
- g_param_spec_boolean ("authorized-to-shutdown",
- NULL, NULL,
- FALSE,
- G_PARAM_READABLE));
+ PROP_AUTHORIZED_TO_SHUTDOWN,
+ g_param_spec_boolean ("authorized-to-shutdown",
+ NULL, NULL,
+ FALSE,
+ G_PARAM_READABLE));
/**
* XfsmShutdownHelper::authorized-to-reboot
- *
+ *
* Whether the user is allowed to preform reboot.
**/
g_object_class_install_property (object_class,
- PROP_AUTHORIZED_TO_RESTART,
- g_param_spec_boolean ("authorized-to-restart",
- NULL, NULL,
- FALSE,
- G_PARAM_READABLE));
+ PROP_AUTHORIZED_TO_RESTART,
+ g_param_spec_boolean ("authorized-to-restart",
+ NULL, NULL,
+ FALSE,
+ G_PARAM_READABLE));
/**
* XfsmShutdownHelper::authorized-to-suspend
- *
+ *
* Whether the user is allowed to preform suspend.
**/
g_object_class_install_property (object_class,
- PROP_AUTHORIZED_TO_SUSPEND,
- g_param_spec_boolean ("authorized-to-suspend",
- NULL, NULL,
- FALSE,
- G_PARAM_READABLE));
+ PROP_AUTHORIZED_TO_SUSPEND,
+ g_param_spec_boolean ("authorized-to-suspend",
+ NULL, NULL,
+ FALSE,
+ G_PARAM_READABLE));
/**
* XfsmShutdownHelper::authorized-to-hibernate
- *
+ *
* Whether the user is allowed to preform hibernate.
**/
g_object_class_install_property (object_class,
- PROP_AUTHORIZED_TO_HIBERNATE,
- g_param_spec_boolean ("authorized-to-hibernate",
- NULL, NULL,
- FALSE,
- G_PARAM_READABLE));
-
+ PROP_AUTHORIZED_TO_HIBERNATE,
+ g_param_spec_boolean ("authorized-to-hibernate",
+ NULL, NULL, FALSE,
+ G_PARAM_READABLE));
+
/**
* XfsmShutdownHelper::can-shutdown
- *
+ *
* Whether the system can do shutdown.
**/
g_object_class_install_property (object_class,
- PROP_CAN_SHUTDOWN,
- g_param_spec_boolean ("can-shutdown",
- NULL, NULL,
- FALSE,
- G_PARAM_READABLE));
+ PROP_CAN_SHUTDOWN,
+ g_param_spec_boolean ("can-shutdown",
+ NULL, NULL,
+ FALSE,
+ G_PARAM_READABLE));
/**
* XfsmShutdownHelper::can-restart
- *
+ *
* Whether the system can do restart.
**/
g_object_class_install_property (object_class,
- PROP_CAN_RESTART,
- g_param_spec_boolean ("can-restart",
- NULL, NULL,
- FALSE,
- G_PARAM_READABLE));
+ PROP_CAN_RESTART,
+ g_param_spec_boolean ("can-restart",
+ NULL, NULL,
+ FALSE,
+ G_PARAM_READABLE));
/**
* XfsmShutdownHelper::can-suspend
- *
+ *
* Whether the system can do suspend.
**/
g_object_class_install_property (object_class,
- PROP_CAN_SUSPEND,
- g_param_spec_boolean ("can-suspend",
- NULL, NULL,
- FALSE,
- G_PARAM_READABLE));
+ PROP_CAN_SUSPEND,
+ g_param_spec_boolean ("can-suspend",
+ NULL, NULL,
+ FALSE,
+ G_PARAM_READABLE));
/**
* XfsmShutdownHelper::can-hibernate
- *
+ *
* Whether the system can do hibernate.
**/
g_object_class_install_property (object_class,
- PROP_CAN_HIBERNATE,
- g_param_spec_boolean ("can-hibernate",
- NULL, NULL,
- FALSE,
- G_PARAM_READABLE));
+ PROP_CAN_HIBERNATE,
+ g_param_spec_boolean ("can-hibernate",
+ NULL, NULL,
+ FALSE,
+ G_PARAM_READABLE));
/**
* XfsmShutdownHelper::user-can-shutdown
- *
+ *
* Whether the user is allowed and the system can shutdown.
**/
g_object_class_install_property (object_class,
- PROP_USER_CAN_SHUTDOWN,
- g_param_spec_boolean ("user-can-shutdown",
- NULL, NULL,
- FALSE,
- G_PARAM_READABLE));
+ PROP_USER_CAN_SHUTDOWN,
+ g_param_spec_boolean ("user-can-shutdown",
+ NULL, NULL,
+ FALSE,
+ G_PARAM_READABLE));
/**
* XfsmShutdownHelper::user-can-restart
- *
+ *
* Whether the user is allowed and the system can restart.
**/
g_object_class_install_property (object_class,
- PROP_USER_CAN_RESTART,
- g_param_spec_boolean ("user-can-restart",
- NULL, NULL,
- FALSE,
- G_PARAM_READABLE));
+ PROP_USER_CAN_RESTART,
+ g_param_spec_boolean ("user-can-restart",
+ NULL, NULL,
+ FALSE,
+ G_PARAM_READABLE));
/**
* XfsmShutdownHelper::user-can-suspend
- *
+ *
* Whether the user is allowed and the system can suspend.
**/
g_object_class_install_property (object_class,
- PROP_USER_CAN_SUSPEND,
- g_param_spec_boolean ("user-can-suspend",
- NULL, NULL,
- FALSE,
- G_PARAM_READABLE));
+ PROP_USER_CAN_SUSPEND,
+ g_param_spec_boolean ("user-can-suspend",
+ NULL, NULL,
+ FALSE,
+ G_PARAM_READABLE));
/**
* XfsmShutdownHelper::user-can-hibernate
- *
+ *
* Whether the user is allowed and the system can hibernate.
**/
g_object_class_install_property (object_class,
- PROP_USER_CAN_HIBERNATE,
- g_param_spec_boolean ("user-can-hibernate",
- NULL, NULL,
- FALSE,
- G_PARAM_READABLE));
+ PROP_USER_CAN_HIBERNATE,
+ g_param_spec_boolean ("user-can-hibernate",
+ NULL, NULL,
+ FALSE,
+ G_PARAM_READABLE));
/**
* XfsmShutdownHelper::require-password
- *
+ *
* Whether the shutdown operation requires a password to
* pass to sudo.
**/
g_object_class_install_property (object_class,
- PROP_REQUIRE_PASSWORD,
- g_param_spec_boolean ("require-password",
- NULL, NULL,
- FALSE,
- G_PARAM_READABLE));
+ PROP_REQUIRE_PASSWORD,
+ g_param_spec_boolean ("require-password",
+ NULL, NULL,
+ FALSE,
+ G_PARAM_READABLE));
}
@@ -1330,7 +1322,7 @@ xfsm_shutdown_helper_init (XfsmShutdownHelper *helper)
helper->system_bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
- if ( G_LIKELY (helper->system_bus) )
+ if (G_LIKELY (helper->system_bus))
{
xfsm_shutdown_helper_check_backends (helper);
}
@@ -1339,15 +1331,16 @@ xfsm_shutdown_helper_init (XfsmShutdownHelper *helper)
{
g_critical ("Failed to connect to the system bus : %s", error->message);
g_error_free (error);
- if ( xfsm_shutdown_helper_check_sudo (helper) )
- helper->shutdown_backend = XFSM_SHUTDOWN_BACKEND_SUDO;
+
+ if (xfsm_shutdown_helper_check_sudo (helper))
+ helper->shutdown_backend = XFSM_SHUTDOWN_BACKEND_SUDO;
}
}
static void xfsm_shutdown_helper_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
@@ -1360,7 +1353,7 @@ static void xfsm_shutdown_helper_get_property (GObject *object,
XfsmShutdownHelper *helper;
helper = XFSM_SHUTDOWN_HELPER (object);
-
+
switch (prop_id)
{
case PROP_AUTHORIZED_TO_SHUTDOWN:
@@ -1417,22 +1410,22 @@ xfsm_shutdown_helper_finalize (GObject *object)
helper = XFSM_SHUTDOWN_HELPER (object);
#ifdef ENABLE_POLKIT
- if ( helper->polkit_proxy )
+ if (helper->polkit_proxy)
g_object_unref (helper->polkit_proxy);
#endif
- if ( helper->system_bus )
+ if (helper->system_bus)
dbus_g_connection_unref (helper->system_bus);
-
+
if (helper->infile != NULL)
fclose (helper->infile);
-
+
if (helper->outfile != NULL)
fclose (helper->outfile);
-
+
if (helper->pid > 0)
waitpid (helper->pid, &status, 0);
-
+
g_free (helper->sudo);
G_OBJECT_CLASS (xfsm_shutdown_helper_parent_class)->finalize (object);
@@ -1444,20 +1437,19 @@ xfsm_shutdown_helper_finalize (GObject *object)
* @action: 'Hibernate' or 'Suspend'
* @error: a #GError
*
- *
**/
#ifdef ENABLE_UPOWER
static gboolean
xfsm_shutdown_helper_upower_sleep (XfsmShutdownHelper *helper,
- const gchar *action,
- GError **error)
+ const gchar *action,
+ GError **error)
{
DBusGProxy *proxy;
GError *error_local = NULL;
const gchar *name, *path, *iface;
gboolean ret;
- if ( helper->devkit_is_upower )
+ if (helper->devkit_is_upower)
{
name = "org.freedesktop.UPower";
path = "/org/freedesktop/UPower";
@@ -1469,45 +1461,45 @@ xfsm_shutdown_helper_upower_sleep (XfsmShutdownHelper *helper,
path = "/org/freedesktop/DeviceKit/Power";
iface = "org.freedesktop.DeviceKit.Power";
}
-
+
g_message (G_STRLOC ": Using %s to %s", name, action);
proxy = dbus_g_proxy_new_for_name_owner (helper->system_bus,
- name,
- path,
- iface,
- &error_local);
-
- if ( !proxy )
+ name,
+ path,
+ iface,
+ &error_local);
+
+ if (!proxy)
{
g_warning ("Failed to create proxy for %s : %s", name, error_local->message);
g_set_error (error, 1, 0, "%s", error_local->message);
g_error_free (error_local);
return FALSE;
}
-
+
ret = dbus_g_proxy_call (proxy, action, &error_local,
- G_TYPE_INVALID,
- G_TYPE_INVALID);
+ G_TYPE_INVALID,
+ G_TYPE_INVALID);
g_object_unref (proxy);
- if ( !ret )
+ if (!ret)
{
/* DBus timeout?*/
- if ( g_error_matches (error_local, DBUS_GERROR, DBUS_GERROR_NO_REPLY) )
+ if (g_error_matches (error_local, DBUS_GERROR, DBUS_GERROR_NO_REPLY))
{
- g_error_free (error_local);
- return TRUE;
+ g_error_free (error_local);
+ return TRUE;
}
else
- {
- g_set_error (error, 1, 0, "%s", error_local->message);
- g_error_free (error_local);
- return FALSE;
- }
+ {
+ g_set_error (error, 1, 0, "%s", error_local->message);
+ g_error_free (error_local);
+ return FALSE;
+ }
}
-
+
return TRUE;
}
#endif /*ENABLE_UPOWER*/
@@ -1518,26 +1510,25 @@ xfsm_shutdown_helper_upower_sleep (XfsmShutdownHelper *helper,
* @action: 'Stop' for shutdown and 'Restart' for reboot.
* @error: a #GError
*
- *
**/
#ifdef ENABLE_CONSOLE_KIT
static gboolean
-xfsm_shutdown_helper_console_kit_shutdown (XfsmShutdownHelper *helper,
- const gchar *action,
- GError **error)
+xfsm_shutdown_helper_console_kit_shutdown (XfsmShutdownHelper *helper,
+ const gchar *action,
+ GError **error)
{
DBusGProxy *proxy;
GError *error_local = NULL;
gboolean ret;
g_message (G_STRLOC ": Using ConsoleKit to %s", action);
-
+
proxy = dbus_g_proxy_new_for_name_owner (helper->system_bus,
- "org.freedesktop.ConsoleKit",
- "/org/freedesktop/ConsoleKit/Manager",
- "org.freedesktop.ConsoleKit.Manager",
- &error_local);
-
+ "org.freedesktop.ConsoleKit",
+ "/org/freedesktop/ConsoleKit/Manager",
+ "org.freedesktop.ConsoleKit.Manager",
+ &error_local);
+
if (!proxy)
{
g_warning ("Failed to create proxy for 'org.freedesktop.ConsoleKit' : %s", error_local->message);
@@ -1545,20 +1536,20 @@ xfsm_shutdown_helper_console_kit_shutdown (XfsmShutdownHelper *helper,
g_error_free (error_local);
return FALSE;
}
-
+
ret = dbus_g_proxy_call (proxy, action, &error_local,
- G_TYPE_INVALID,
- G_TYPE_INVALID);
-
+ G_TYPE_INVALID,
+ G_TYPE_INVALID);
+
g_object_unref (proxy);
-
- if ( !ret )
+
+ if (!ret)
{
g_set_error (error, 1, 0, "%s", error_local->message);
g_error_free (error_local);
return FALSE;
}
-
+
return TRUE;
}
#endif /*ENABLE_CONSOLE_KIT*/
@@ -1573,22 +1564,22 @@ xfsm_shutdown_helper_console_kit_shutdown (XfsmShutdownHelper *helper,
#ifdef ENABLE_HAL
static gboolean
xfsm_shutdown_helper_hal_send (XfsmShutdownHelper *helper,
- const gchar *action,
- GError **error)
+ const gchar *action,
+ GError **error)
{
DBusGProxy *proxy;
GError *error_local = NULL;
gboolean ret;
gint return_code;
-
+
g_message (G_STRLOC ": Using ConsoleKit to %s", action);
proxy = dbus_g_proxy_new_for_name_owner (helper->system_bus,
- "org.freedesktop.Hal",
- "/org/freedesktop/Hal/devices/computer",
- "org.freedesktop.Hal.Device.SystemPowerManagement",
- &error_local);
- if ( !proxy )
+ "org.freedesktop.Hal",
+ "/org/freedesktop/Hal/devices/computer",
+ "org.freedesktop.Hal.Device.SystemPowerManagement",
+ &error_local);
+ if (!proxy)
{
g_warning ("Failed to create proxy for 'org.freedesktop.Hal' : %s", error_local->message);
g_set_error (error, 1, 0, "%s", error_local->message);
@@ -1600,37 +1591,37 @@ xfsm_shutdown_helper_hal_send (XfsmShutdownHelper *helper,
{
gint seconds = 0;
ret = dbus_g_proxy_call (proxy, action, &error_local,
- G_TYPE_INT, seconds,
- G_TYPE_INVALID,
- G_TYPE_INT, &return_code,
- G_TYPE_INVALID);
+ G_TYPE_INT, seconds,
+ G_TYPE_INVALID,
+ G_TYPE_INT, &return_code,
+ G_TYPE_INVALID);
}
else
{
ret = dbus_g_proxy_call (proxy, action, &error_local,
- G_TYPE_INVALID,
- G_TYPE_INT, &return_code,
- G_TYPE_INVALID);
+ G_TYPE_INVALID,
+ G_TYPE_INT, &return_code,
+ G_TYPE_INVALID);
}
g_object_unref (proxy);
- if ( !ret )
+ if (!ret)
{
/* A D-Bus timeout? */
- if ( g_error_matches (error_local, DBUS_GERROR, DBUS_GERROR_NO_REPLY) )
- {
- g_error_free (error_local);
- return TRUE;
- }
+ if (g_error_matches (error_local, DBUS_GERROR, DBUS_GERROR_NO_REPLY))
+ {
+ g_error_free (error_local);
+ return TRUE;
+ }
else
- {
- g_set_error (error, 1, 0, "%s", error_local->message);
- g_error_free (error_local);
- return FALSE;
- }
+ {
+ g_set_error (error, 1, 0, "%s", error_local->message);
+ g_error_free (error_local);
+ return FALSE;
+ }
}
-
+
return TRUE;
}
#endif /*ENABLE_HAL*/
@@ -1642,52 +1633,51 @@ xfsm_shutdown_helper_hal_send (XfsmShutdownHelper *helper,
**/
static gboolean
xfsm_shutdown_helper_sudo_send (XfsmShutdownHelper *helper,
- const gchar *action,
- GError **error)
+ const gchar *action,
+ GError **error)
{
gchar response[256];
-
+
fprintf (helper->outfile, "%s\n", action);
fflush (helper->outfile);
g_message (G_STRLOC ": Using ConsoleKit to %s",action);
-
+
if (ferror (helper->outfile))
{
if (errno == EINTR)
- {
- /* probably succeeded but the helper got killed */
- return TRUE;
- }
-
+ {
+ /* probably succeeded but the helper got killed */
+ return TRUE;
+ }
+
g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
- _("Error sending command to shutdown helper: %s"),
- strerror (errno));
+ _("Error sending command to shutdown helper: %s"),
+ strerror (errno));
return FALSE;
}
if (fgets (response, 256, helper->infile) == NULL)
{
if (errno == EINTR)
- {
- /* probably succeeded but the helper got killed */
- return TRUE;
- }
-
+ {
+ /* probably succeeded but the helper got killed */
+ return TRUE;
+ }
+
g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
- _("Error receiving response from shutdown helper: %s"),
- strerror (errno));
-
+ _("Error receiving response from shutdown helper: %s"),
+ strerror (errno));
+
return FALSE;
}
if (strncmp (response, "SUCCEED", 7) != 0)
{
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
- _("Shutdown command failed"));
-
+ _("Shutdown command failed"));
+
return FALSE;
-
}
return TRUE;
}
@@ -1695,7 +1685,6 @@ xfsm_shutdown_helper_sudo_send (XfsmShutdownHelper *helper,
/**
* xfsm_shutdown_helper_new:
*
- *
**/
XfsmShutdownHelper *
xfsm_shutdown_helper_new (void)
@@ -1703,7 +1692,7 @@ xfsm_shutdown_helper_new (void)
XfsmShutdownHelper *xfsm_shutdown_helper = NULL;
xfsm_shutdown_helper = g_object_new (XFSM_TYPE_SHUTDOWN_HELPER, NULL);
-
+
return xfsm_shutdown_helper;
}
@@ -1781,7 +1770,7 @@ gboolean xfsm_shutdown_helper_send_password (XfsmShutdownHelper *helper, const g
helper->require_password = FALSE;
break;
}
- }
+ }
}
return TRUE;
@@ -1795,7 +1784,7 @@ gboolean xfsm_shutdown_helper_send_password (XfsmShutdownHelper *helper, const g
gboolean xfsm_shutdown_helper_shutdown (XfsmShutdownHelper *helper, GError **error)
{
g_return_val_if_fail (!error || !*error, FALSE);
-
+
#ifdef ENABLE_CONSOLE_KIT
if ( helper->shutdown_backend == XFSM_SHUTDOWN_BACKEND_CONSOLE_KIT )
{
@@ -1809,7 +1798,7 @@ gboolean xfsm_shutdown_helper_shutdown (XfsmShutdownHelper *helper, GError **err
return xfsm_shutdown_helper_hal_send (helper, "Shutdown", error);
}
#endif
-
+
/*Use Sudo mode*/
return xfsm_shutdown_helper_sudo_send (helper, "POWEROFF", error);
@@ -1901,11 +1890,11 @@ gboolean xfsm_shutdown_helper_hibernate (XfsmShutdownHelper *helper, GError **er
*
**/
gboolean xfsm_shutdown_helper_send_command (XfsmShutdownHelper *helper,
- XfsmShutdownType shutdown_type,
- GError **error)
+ XfsmShutdownType shutdown_type,
+ GError **error)
{
g_return_val_if_fail (!error || !*error, FALSE);
-
+
switch (shutdown_type)
{
case XFSM_SHUTDOWN_HALT:
More information about the Xfce4-commits
mailing list