summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO1
-rw-r--r--settings/xfpm-settings.c8
-rw-r--r--src/xfpm-disks.c14
3 files changed, 12 insertions, 11 deletions
diff --git a/TODO b/TODO
index b7cb0c9d..6aad5a8a 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 81999953..f974f1f4 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 3f38012e..a9ccd144 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)
{