[Xfce4-commits] <xfce4-power-manager:master> Fix some typos in the previous commit concerning devicekit-disks.

Ali Abdallah noreply at xfce.org
Sat Jan 30 02:18:14 CET 2010


Updating branch refs/heads/master
         to a830826ce72d043c7d6575ca110deb0e51ca9b2d (commit)
       from f9292aa5c359545cf2043d8c58899367d113bdcf (commit)

commit a830826ce72d043c7d6575ca110deb0e51ca9b2d
Author: Ali Abdallah <ali at ali-xfce.org>
Date:   Fri Nov 6 17:17:01 2009 +0100

    Fix some typos in the previous commit concerning devicekit-disks.

 TODO                     |    1 -
 settings/xfpm-settings.c |    8 ++++----
 src/xfpm-disks.c         |   14 ++++++++------
 3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/TODO b/TODO
index b7cb0c9..6aad5a8 100644
--- a/TODO
+++ b/TODO
@@ -1,3 +1,2 @@
-* Hard drive spinning.
 * Probably provide a PermissionDenied error on the inhibit interface?
 * Update the documentations.
diff --git a/settings/xfpm-settings.c b/settings/xfpm-settings.c
index 8199995..f974f1f 100644
--- a/settings/xfpm-settings.c
+++ b/settings/xfpm-settings.c
@@ -708,9 +708,9 @@ void on_battery_spin_changed (GtkWidget *w,  XfconfChannel *channel)
 {
     gboolean val = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(w));
     
-    if ( !xfconf_channel_set_bool (channel, SPIN_DOWN_ON_BATTERY, val) )
+    if ( !xfconf_channel_set_bool (channel, PROPERTIES_PREFIX SPIN_DOWN_ON_BATTERY, val) )
     {
-	g_critical ("Unable to set value for property %s\n", SPIN_DOWN_ON_BATTERY);
+	g_critical ("Unable to set value for property %s", SPIN_DOWN_ON_BATTERY);
     }
     
 }
@@ -719,9 +719,9 @@ void on_ac_spin_changed	(GtkWidget *w, XfconfChannel *channel)
 {
     gboolean val = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(w));
     
-    if ( !xfconf_channel_set_bool (channel, SPIN_DOWN_ON_AC, val) )
+    if ( !xfconf_channel_set_bool (channel, PROPERTIES_PREFIX SPIN_DOWN_ON_AC, val) )
     {
-	g_critical ("Unable to set value for property %s\n", SPIN_DOWN_ON_AC);
+	g_critical ("Unable to set value for property %s", SPIN_DOWN_ON_AC);
     }
 }
 
diff --git a/src/xfpm-disks.c b/src/xfpm-disks.c
index 3f38012..a9ccd14 100644
--- a/src/xfpm-disks.c
+++ b/src/xfpm-disks.c
@@ -101,13 +101,14 @@ xfpm_disks_enable_spin_down_timeouts (XfpmDisks *disks, gint timeout)
     
     dbus_g_proxy_call (disks->priv->proxy, "DriveSetAllSpindownTimeouts", &error,
 		       G_TYPE_INT, timeout,
-		       G_TYPE_STRING, options,
-		       G_TYPE_STRING, disks->priv->cookie,
+		       G_TYPE_STRV, options,
+		       G_TYPE_INVALID,
+		       G_TYPE_STRING, &disks->priv->cookie,
 		       G_TYPE_INVALID);
 		       
     if ( error )
     {
-	g_warning ("Failed to unset spindown timeouts : %s", error->message);
+	g_warning ("Failed to set spindown timeouts : %s", error->message);
 	g_error_free (error);
 	disks->priv->set = FALSE;
     }
@@ -123,7 +124,7 @@ xfpm_disks_set_spin_timeouts (XfpmDisks *disks)
     if (!disks->priv->can_spin )
 	return;
     
-    g_object_get (G_OBJECT (disks),
+    g_object_get (G_OBJECT (disks->priv->dkp),
 		  "on-battery", &on_battery,
 		  NULL);
 
@@ -144,9 +145,10 @@ xfpm_disks_set_spin_timeouts (XfpmDisks *disks)
     
     g_debug ("On Battery=%d spin_down_enabled=%d timeout=%d\n", on_battery, enabled, timeout);
     
-    if ( !enabled && disks->priv->set && disks->priv->cookie)
+    if ( !enabled )
     {
-	xfpm_disks_disable_spin_down_timeouts (disks);
+	if ( disks->priv->set && disks->priv->cookie )
+	    xfpm_disks_disable_spin_down_timeouts (disks);
     }
     else if ( timeout != 0 && timeout > 120 && !disks->priv->set)
     {



More information about the Xfce4-commits mailing list