[gnome-power-manager] Remove the 'event-when-closed-battery' setting, this makes no sense if FALSE



commit ca96a57f6eadea9a0380ad4e4a9e99509bfcbc1d
Author: Richard Hughes <richard hughsie com>
Date:   Thu Nov 18 22:38:05 2010 +0000

    Remove the 'event-when-closed-battery' setting, this makes no sense if FALSE

 data/org.gnome.power-manager.gschema.migrate |    1 -
 data/org.gnome.power-manager.gschema.xml     |    5 -----
 src/gpm-common.h                             |    1 -
 src/gpm-manager.c                            |   14 ++++----------
 4 files changed, 4 insertions(+), 17 deletions(-)
---
diff --git a/data/org.gnome.power-manager.gschema.migrate b/data/org.gnome.power-manager.gschema.migrate
index 3b1bdca..aad17ed 100644
--- a/data/org.gnome.power-manager.gschema.migrate
+++ b/data/org.gnome.power-manager.gschema.migrate
@@ -1,5 +1,4 @@
 [org.gnome.power-manager]
-event-when-closed-battery = /apps/gnome-power-manager/actions/event_when_closed_battery
 backlight-enable = /apps/gnome-power-manager/backlight/enable
 backlight-battery-reduce = /apps/gnome-power-manager/backlight/battery_reduce
 brightness-dim-battery = /apps/gnome-power-manager/backlight/brightness_dim_battery
diff --git a/data/org.gnome.power-manager.gschema.xml b/data/org.gnome.power-manager.gschema.xml
index 905b489..8dd9502 100644
--- a/data/org.gnome.power-manager.gschema.xml
+++ b/data/org.gnome.power-manager.gschema.xml
@@ -12,11 +12,6 @@
     <value nick="off" value="3"/>
   </enum>
   <schema id="org.gnome.power-manager" path="/apps/gnome-power-manager/">
-    <key name="event-when-closed-battery" type="b">
-      <default>true</default>
-      <summary>If the battery event should occur when the lid is shut and the power disconnected</summary>
-      <description>If the battery lid close event should occur (for example 'Suspend when lid closed on battery') when the lid is previously shut and the AC power disconnected at a later time.</description>
-    </key>
     <key name="backlight-enable" type="b">
       <default>true</default>
       <summary>Allow backlight brightness adjustment</summary>
diff --git a/src/gpm-common.h b/src/gpm-common.h
index e3ef604..cce6be0 100644
--- a/src/gpm-common.h
+++ b/src/gpm-common.h
@@ -44,7 +44,6 @@ G_BEGIN_DECLS
 #define GSD_SETTINGS_ACTION_CRITICAL_BATT		"critical-battery-action"
 #define GSD_SETTINGS_ACTION_SLEEP_TYPE_AC		"sleep-inactive-ac-type"
 #define GSD_SETTINGS_ACTION_SLEEP_TYPE_BATT		"sleep-inactive-battery-type"
-#define GPM_SETTINGS_SLEEP_WHEN_CLOSED			"event-when-closed-battery"
 
 /* backlight stuff */
 #define GPM_SETTINGS_BACKLIGHT_ENABLE			"backlight-enable"
diff --git a/src/gpm-manager.c b/src/gpm-manager.c
index de00e01..4c9fc3a 100644
--- a/src/gpm-manager.c
+++ b/src/gpm-manager.c
@@ -1064,7 +1064,6 @@ gpm_manager_get_spindown_timeout (GpmManager *manager)
 static void
 gpm_manager_client_changed_cb (UpClient *client, GpmManager *manager)
 {
-	gboolean event_when_closed;
 	gint timeout;
 	gboolean on_battery;
 	gboolean lid_is_closed;
@@ -1120,17 +1119,12 @@ gpm_manager_client_changed_cb (UpClient *client, GpmManager *manager)
 	else
 		gpm_manager_play (manager, GPM_MANAGER_SOUND_POWER_UNPLUG, FALSE);
 
-	/* We do the lid close on battery action if the ac adapter is removed
-	   when the laptop is closed and on battery. Fixes #331655 */
-	event_when_closed = g_settings_get_boolean (manager->priv->settings, GPM_SETTINGS_SLEEP_WHEN_CLOSED);
-
 	/* We keep track of the lid state so we can do the
-	   lid close on battery action if the ac adapter is removed when the laptop
-	   is closed. Fixes #331655 */
-	if (event_when_closed && on_battery && lid_is_closed) {
+	 * lid close on battery action if the ac adapter is removed when the laptop
+	 * is closed */
+	if (on_battery && lid_is_closed) {
 		gpm_manager_perform_policy (manager, GSD_SETTINGS_BUTTON_LID_BATT,
-					    "The lid has been closed, and the ac adapter "
-					    "removed (and GSettings is okay).");
+					    "The lid has been closed, and the ac adapter removed.");
 	}
 }
 



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