[gnome-session] gsm: Fix various warnings about unused variables
- From: Vincent Untz <vuntz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-session] gsm: Fix various warnings about unused variables
- Date: Sat, 2 Jul 2011 08:22:55 +0000 (UTC)
commit 399f3af4a9b402401379fb0bd57feeac2eba6751
Author: Vincent Untz <vuntz gnome org>
Date: Sat Jul 2 10:21:11 2011 +0200
gsm: Fix various warnings about unused variables
gnome-session/gsm-consolekit.c | 13 +++++++++++++
gnome-session/gsm-fail-whale-dialog.c | 2 --
gnome-session/gsm-inhibit-dialog.c | 4 ----
gnome-session/gsm-manager.c | 6 +++---
gnome-session/test-client-dbus.c | 5 +++++
gnome-session/test-inhibit.c | 2 --
6 files changed, 21 insertions(+), 11 deletions(-)
---
diff --git a/gnome-session/gsm-consolekit.c b/gnome-session/gsm-consolekit.c
index 530ac39..f53993f 100644
--- a/gnome-session/gsm-consolekit.c
+++ b/gnome-session/gsm-consolekit.c
@@ -760,6 +760,13 @@ gsm_consolekit_can_restart (GsmConsolekit *manager)
G_TYPE_BOOLEAN, &can_restart,
G_TYPE_INVALID);
+ if (!res) {
+ g_warning ("Could not query CanRestart from ConsoleKit: %s",
+ error->message);
+ g_error_free (error);
+ return FALSE;
+ }
+
return can_restart;
}
@@ -787,6 +794,12 @@ gsm_consolekit_can_stop (GsmConsolekit *manager)
G_TYPE_BOOLEAN, &can_stop,
G_TYPE_INVALID);
+ if (!res) {
+ g_warning ("Could not query CanStop from ConsoleKit: %s",
+ error->message);
+ g_error_free (error);
+ return FALSE;
+ }
return can_stop;
}
diff --git a/gnome-session/gsm-fail-whale-dialog.c b/gnome-session/gsm-fail-whale-dialog.c
index 61d0923..d54cf18 100644
--- a/gnome-session/gsm-fail-whale-dialog.c
+++ b/gnome-session/gsm-fail-whale-dialog.c
@@ -221,10 +221,8 @@ gsm_fail_whale_dialog_get_preferred_height (GtkWidget *widget,
static void
gsm_fail_whale_dialog_class_init (GsmFailWhaleDialogClass *klass)
{
- GObjectClass *gobject_class;
GtkWidgetClass *widget_class;
- gobject_class = G_OBJECT_CLASS (klass);
widget_class = GTK_WIDGET_CLASS (klass);
widget_class->realize = gsm_fail_whale_dialog_realize;
diff --git a/gnome-session/gsm-inhibit-dialog.c b/gnome-session/gsm-inhibit-dialog.c
index 0912025..1ec3a8a 100644
--- a/gnome-session/gsm-inhibit-dialog.c
+++ b/gnome-session/gsm-inhibit-dialog.c
@@ -360,8 +360,6 @@ get_pixmap_for_window (Display *display,
Picture src_picture;
Picture dst_picture;
gboolean has_alpha;
- int x;
- int y;
int width;
int height;
@@ -369,8 +367,6 @@ get_pixmap_for_window (Display *display,
format = XRenderFindVisualFormat (display, attr.visual);
has_alpha = (format->type == PictTypeDirect && format->direct.alphaMask);
- x = attr.x;
- y = attr.y;
width = attr.width;
height = attr.height;
diff --git a/gnome-session/gsm-manager.c b/gnome-session/gsm-manager.c
index 72efc39..870af4a 100644
--- a/gnome-session/gsm-manager.c
+++ b/gnome-session/gsm-manager.c
@@ -377,7 +377,7 @@ app_condition_changed (GsmApp *app,
error = NULL;
res = gsm_client_stop (client, &error);
- if (error != NULL) {
+ if (! res) {
g_warning ("Not able to stop app client from its condition: %s",
error->message);
g_error_free (error);
@@ -388,7 +388,7 @@ app_condition_changed (GsmApp *app,
/* If we don't have a client then we should try to kill the app */
error = NULL;
res = gsm_app_stop (app, &error);
- if (error != NULL) {
+ if (! res) {
g_warning ("Not able to stop app from its condition: %s",
error->message);
g_error_free (error);
@@ -1835,7 +1835,7 @@ _disconnect_client (GsmManager *manager,
error = NULL;
res = gsm_app_restart (app, &error);
- if (error != NULL) {
+ if (! res) {
if (is_app_required (manager, app)) {
on_required_app_failure (manager, app);
} else {
diff --git a/gnome-session/test-client-dbus.c b/gnome-session/test-client-dbus.c
index 863ae67..56a7092 100644
--- a/gnome-session/test-client-dbus.c
+++ b/gnome-session/test-client-dbus.c
@@ -88,6 +88,11 @@ on_client_query_end_session (DBusGProxy *proxy,
G_TYPE_STRING, reason,
G_TYPE_INVALID,
G_TYPE_INVALID);
+
+ if (! res) {
+ g_warning ("Failed to respond to EndSession: %s", error->message);
+ g_error_free (error);
+ }
}
static void
diff --git a/gnome-session/test-inhibit.c b/gnome-session/test-inhibit.c
index 8a08ab9..4b5228b 100644
--- a/gnome-session/test-inhibit.c
+++ b/gnome-session/test-inhibit.c
@@ -73,13 +73,11 @@ do_inhibit_for_window (GdkWindow *window)
{
GError *error;
gboolean res;
- const char *startup_id;
const char *app_id;
const char *reason;
guint toplevel_xid;
guint flags;
- startup_id = g_getenv ("DESKTOP_AUTOSTART_ID");
#if 1
app_id = "nautilus-cd-burner";
reason = "A CD burn is in progress.";
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]