path: root/src/dkp-device.c
diff options
authorDavid Zeuthen <>2008-11-11 13:58:26 -0500
committerDavid Zeuthen <>2008-11-11 13:58:26 -0500
commitc9dbc80f367c5f537e96cf634badbae6fa2adc91 (patch)
treeaad708ab3601defd5d0e03a589fdf38c8d812f8c /src/dkp-device.c
parentd34ad4346454b9bf03cd60a5d65fed558e691f43 (diff)
turn some methods into properties
GetOnBattery() -> :on-battery (bool) GetLowBattery() -> :on-low-battery (bool) CanSuspend() -> :can-suspend (bool) CanHibernate() -> :can-hibernate (bool) also add a new property for the daemon version :daemon-version (string) introduce a new Changed() signal that replaces ::LowBatteryChanged() ::OnBatteryChanged() Also fix a few bugs - we need to compute ::on-battery and ::on-low-battery *after* the actual device is updated - need to fire Device::Changed() before Power::DeviceChanged() otherwise devkit-power --monitor-detail lies also fix up libdevkit-power and devkit-power(1) to use these changes.
Diffstat (limited to 'src/dkp-device.c')
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dkp-device.c b/src/dkp-device.c
index bdd10a5..4a92f1d 100644
--- a/src/dkp-device.c
+++ b/src/dkp-device.c
@@ -580,9 +580,15 @@ dkp_device_emit_changed (DkpDevice *device)
dkp_history_set_time_empty_data (device->priv->history, obj->time_to_empty);
egg_debug ("emitting changed on %s", device->priv->obj->native_path);
+ /* The order here matters; we want Device::Changed() before
+ * the DeviceChanged() signal on the main object; otherwise
+ * clients that only listens on DeviceChanged() won't be
+ * fully caught up...
+ */
+ g_signal_emit (device, signals[CHANGED_SIGNAL], 0);
g_signal_emit_by_name (device->priv->daemon, "device-changed",
device->priv->object_path, NULL);
- g_signal_emit (device, signals[CHANGED_SIGNAL], 0);