# Ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/gnome-power-manager/+bug/447304
# Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=598221
# Description: Attempt to fix a crash when AC is plugged in and out on some laptops


Index: gnome-power-manager-2.28.0/src/gpm-manager.c
===================================================================
--- gnome-power-manager-2.28.0.orig/src/gpm-manager.c	2009-09-13 06:24:54.000000000 -0400
+++ gnome-power-manager-2.28.0/src/gpm-manager.c	2009-10-12 20:46:55.255720692 -0400
@@ -791,11 +791,11 @@
 /**
  * gpm_manager_get_spindown_timeout:
  **/
-static guint
+static gint
 gpm_manager_get_spindown_timeout (GpmManager *manager)
 {
 	gboolean enabled;
-	guint timeout;
+	gint timeout;
 
 	/* get policy */
 	if (!manager->priv->on_battery) {
@@ -817,7 +817,7 @@
 gpm_manager_client_changed_cb (DkpClient *client, GpmManager *manager)
 {
 	gboolean event_when_closed;
-	guint timeout;
+	gint timeout;
 	gboolean on_battery;
 
 	/* get the on-battery state */
@@ -1800,7 +1800,7 @@
 gpm_manager_init (GpmManager *manager)
 {
 	gboolean check_type_cpu;
-	guint timeout;
+	gint timeout;
 	DBusGConnection *connection;
 	GError *error = NULL;
 	guint version;
Index: gnome-power-manager-2.28.0/src/gpm-disks.c
===================================================================
--- gnome-power-manager-2.28.0.orig/src/gpm-disks.c	2009-09-11 11:28:46.000000000 -0400
+++ gnome-power-manager-2.28.0/src/gpm-disks.c	2009-10-12 20:46:55.255720692 -0400
@@ -78,7 +78,7 @@
  * gpm_disks_register:
  **/
 static gboolean
-gpm_disks_register (GpmDisks *disks, guint timeout)
+gpm_disks_register (GpmDisks *disks, gint timeout)
 {
 	gboolean ret = FALSE;
 	GError *error = NULL;
@@ -110,7 +110,7 @@
  * gpm_disks_set_spindown_timeout:
  **/
 gboolean
-gpm_disks_set_spindown_timeout (GpmDisks *disks, guint timeout)
+gpm_disks_set_spindown_timeout (GpmDisks *disks, gint timeout)
 {
 	gboolean ret = TRUE;
 
Index: gnome-power-manager-2.28.0/src/gpm-disks.h
===================================================================
--- gnome-power-manager-2.28.0.orig/src/gpm-disks.h	2009-10-12 20:48:15.545721393 -0400
+++ gnome-power-manager-2.28.0/src/gpm-disks.h	2009-10-12 20:48:30.635720811 -0400
@@ -50,7 +50,7 @@
 GpmDisks	*gpm_disks_new				(void);
 
 gboolean	 gpm_disks_set_spindown_timeout		(GpmDisks	*disks,
-							 guint		 timeout);
+							 gint		 timeout);
 
 G_END_DECLS
 
