[gnome-power-manager] trivial: fix up a few issues with the last patch
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-power-manager] trivial: fix up a few issues with the last patch
- Date: Fri, 25 Feb 2011 14:51:53 +0000 (UTC)
commit 1108d12ed9ecd16924bf3aea0e7d9f4b5269077b
Author: Richard Hughes <richard hughsie com>
Date: Fri Feb 25 14:51:07 2011 +0000
trivial: fix up a few issues with the last patch
data/org.gnome.power-manager.gschema.xml.in | 4 ++--
src/gpm-kbd-backlight.c | 13 ++++++-------
src/gpm-manager.c | 4 ++--
3 files changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/data/org.gnome.power-manager.gschema.xml.in b/data/org.gnome.power-manager.gschema.xml.in
index c773de6..4650d5b 100644
--- a/data/org.gnome.power-manager.gschema.xml.in
+++ b/data/org.gnome.power-manager.gschema.xml.in
@@ -39,12 +39,12 @@
</key>
<key name="kbd-brightness-dim-by-on-battery" type="i">
<default>50</default>
- <_summary>Percent to reduce keyboard backlight by when on battery power.</summary>
+ <_summary>Percent to reduce keyboard backlight by when on battery power.</_summary>
<_description>The percentage to reduce the keyboard backlight by when on battery power. For example, if set to '60', the backlight will be cut by 40% on battery power. Legal values are between 0 and 100.</_description>
</key>
<key name="kbd-brightness-dim-by-on-idle" type="i">
<default>75</default>
- <_summary>Percent to reduce keyboard backlight by when idle.</summary>
+ <_summary>Percent to reduce keyboard backlight by when idle.</_summary>
<_description>The percentage to reduce the keyboard backlight by when idle. For example, if set to '60', the backlight will be cut by 40% when idle. Legal values are between 0 and 100.</_description>
</key>
<key name="use-time-for-policy" type="b">
diff --git a/src/gpm-kbd-backlight.c b/src/gpm-kbd-backlight.c
index 5334607..e640ad6 100644
--- a/src/gpm-kbd-backlight.c
+++ b/src/gpm-kbd-backlight.c
@@ -59,8 +59,8 @@ struct GpmKbdBacklightPrivate
GTimer *idle_timer;
guint idle_dim_timeout;
guint master_percentage;
- guint brightness;
- guint max_brightness;
+ guint brightness;
+ guint max_brightness;
guint brightness_percent;
GDBusProxy *upower_proxy;
GDBusConnection *bus_connection;
@@ -125,9 +125,8 @@ gpm_kbd_backlight_set (GpmKbdBacklight *backlight,
guint goal;
g_return_val_if_fail (GPM_IS_KBD_BACKLIGHT (backlight), FALSE);
- /* if we're setting the same we are, don't bother */
- //g_return_val_if_fail (backlight->priv->brightness_percent != percentage, FALSE);
+ /* if we're setting the same we are, don't bother */
goal = gpm_discrete_from_percent (percentage, backlight->priv->max_brightness);
scale = percentage > backlight->priv->brightness_percent ? 1 : -1;
@@ -169,7 +168,7 @@ gpm_kbd_backlight_brightness_down (GpmKbdBacklight *backlight)
{
guint new;
- // we can possibly go below 0 here, so by converting to a gint we avoid underflow errors.
+ /* we can possibly go below 0 here, so by converting to a gint we avoid underflow errors */
new = MAX ((gint) backlight->priv->brightness_percent - GPM_KBD_BACKLIGHT_STEP, 0);
return gpm_kbd_backlight_set (backlight, new);
}
@@ -333,8 +332,8 @@ static gboolean
gpm_kbd_backlight_dbus_property_set (GDBusConnection *connection,
const gchar *sender,
const gchar *object_path,
- const gchar *interface_name,
- const gchar *property_name,
+ const gchar *interface_name,
+ const gchar *property_name,
GVariant *value,
GError **error,
gpointer user_data)
diff --git a/src/gpm-manager.c b/src/gpm-manager.c
index d6f3de8..272dc62 100644
--- a/src/gpm-manager.c
+++ b/src/gpm-manager.c
@@ -2231,7 +2231,7 @@ gpm_manager_bus_acquired_cb (GDBusConnection *connection,
if (manager->priv->backlight != NULL) {
gpm_backlight_register_dbus (manager->priv->backlight, connection);
}
-
+
if (manager->priv->kbd_backlight != NULL) {
gpm_kbd_backlight_register_dbus (manager->priv->kbd_backlight,
connection,
@@ -2321,7 +2321,7 @@ gpm_manager_init (GpmManager *manager)
/* try an start an interactive service */
manager->priv->backlight = gpm_backlight_new ();
-
+
/* try and start an interactive service */
manager->priv->kbd_backlight = gpm_kbd_backlight_new ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]