diff --git a/devkit-power-gobject/dkp-client.c b/devkit-power-gobject/dkp-client.c index e8efe3d..f654edd 100644 --- a/devkit-power-gobject/dkp-client.c +++ b/devkit-power-gobject/dkp-client.c @@ -253,52 +253,51 @@ dkp_client_ensure_properties (DkpClient *client) goto out; } - - value = g_hash_table_lookup (props, "daemon-version"); + value = g_hash_table_lookup (props, "DaemonVersion"); if (value == NULL) { - g_warning ("No 'daemon-version' property"); + g_warning ("No 'DaemonVersion' property"); goto out; } client->priv->daemon_version = g_strdup (g_value_get_string (value)); - value = g_hash_table_lookup (props, "can-suspend"); + value = g_hash_table_lookup (props, "CanSuspend"); if (value == NULL) { - g_warning ("No 'can-suspend' property"); + g_warning ("No 'CanSuspend' property"); goto out; } client->priv->can_suspend = g_value_get_boolean (value); - value = g_hash_table_lookup (props, "can-hibernate"); + value = g_hash_table_lookup (props, "CanHibernate"); if (value == NULL) { - g_warning ("No 'can-hibernate' property"); + g_warning ("No 'CanHibernate' property"); goto out; } client->priv->can_hibernate = g_value_get_boolean (value); - value = g_hash_table_lookup (props, "lid-is-closed"); + value = g_hash_table_lookup (props, "LidIsClosed"); if (value == NULL) { - g_warning ("No 'lid-is-closed' property"); + g_warning ("No 'LidIsClosed' property"); goto out; } client->priv->lid_is_closed = g_value_get_boolean (value); - value = g_hash_table_lookup (props, "on-battery"); + value = g_hash_table_lookup (props, "OnBattery"); if (value == NULL) { - g_warning ("No 'on-battery' property"); + g_warning ("No 'OnBattery' property"); goto out; } client->priv->on_battery = g_value_get_boolean (value); - value = g_hash_table_lookup (props, "on-low-battery"); + value = g_hash_table_lookup (props, "OnLowBattery"); if (value == NULL) { - g_warning ("No 'on-low-battery' property"); + g_warning ("No 'OnLowBattery' property"); goto out; } client->priv->on_low_battery = g_value_get_boolean (value); - value = g_hash_table_lookup (props, "lid-is-present"); + value = g_hash_table_lookup (props, "LidIsPresent"); if (value == NULL) { - g_warning ("No 'lid-is-present' property"); + g_warning ("No 'LidIsPresent' property"); goto out; } client->priv->lid_is_present = g_value_get_boolean (value); @@ -524,8 +523,6 @@ dkp_client_class_init (DkpClientClass *klass) object_class->get_property = dkp_client_get_property; object_class->finalize = dkp_client_finalize; - - g_object_class_install_property (object_class, PROP_DAEMON_VERSION, g_param_spec_string ("daemon-version", diff --git a/devkit-power-gobject/dkp-device.c b/devkit-power-gobject/dkp-device.c index 06dcf78..abedeaa 100644 --- a/devkit-power-gobject/dkp-device.c +++ b/devkit-power-gobject/dkp-device.c @@ -147,59 +147,59 @@ out: static void dkp_device_collect_props_cb (const char *key, const GValue *value, DkpDevice *device) { - if (g_strcmp0 (key, "native-path") == 0) + if (g_strcmp0 (key, "NativePath") == 0) device->priv->native_path = g_strdup (g_value_get_string (value)); - else if (g_strcmp0 (key, "vendor") == 0) + else if (g_strcmp0 (key, "Vendor") == 0) device->priv->vendor = g_strdup (g_value_get_string (value)); - else if (g_strcmp0 (key, "model") == 0) + else if (g_strcmp0 (key, "Model") == 0) device->priv->model = g_strdup (g_value_get_string (value)); - else if (g_strcmp0 (key, "serial") == 0) + else if (g_strcmp0 (key, "Serial") == 0) device->priv->serial = g_strdup (g_value_get_string (value)); - else if (g_strcmp0 (key, "update-time") == 0) + else if (g_strcmp0 (key, "UpdateTime") == 0) device->priv->update_time = g_value_get_uint64 (value); - else if (g_strcmp0 (key, "type") == 0) + else if (g_strcmp0 (key, "Type") == 0) device->priv->type = g_value_get_uint (value); - else if (g_strcmp0 (key, "online") == 0) + else if (g_strcmp0 (key, "Online") == 0) device->priv->online = g_value_get_boolean (value); - else if (g_strcmp0 (key, "has-history") == 0) + else if (g_strcmp0 (key, "HasHistory") == 0) device->priv->has_history = g_value_get_boolean (value); - else if (g_strcmp0 (key, "has-statistics") == 0) + else if (g_strcmp0 (key, "HasStatistics") == 0) device->priv->has_statistics = g_value_get_boolean (value); - else if (g_strcmp0 (key, "energy") == 0) + else if (g_strcmp0 (key, "Energy") == 0) device->priv->energy = g_value_get_double (value); - else if (g_strcmp0 (key, "energy-empty") == 0) + else if (g_strcmp0 (key, "EnergyEmpty") == 0) device->priv->energy_empty = g_value_get_double (value); - else if (g_strcmp0 (key, "energy-full") == 0) + else if (g_strcmp0 (key, "EnergyFull") == 0) device->priv->energy_full = g_value_get_double (value); - else if (g_strcmp0 (key, "energy-full-design") == 0) + else if (g_strcmp0 (key, "EnergyFullDesign") == 0) device->priv->energy_full_design = g_value_get_double (value); - else if (g_strcmp0 (key, "energy-rate") == 0) + else if (g_strcmp0 (key, "EnergyRate") == 0) device->priv->energy_rate = g_value_get_double (value); - else if (g_strcmp0 (key, "voltage") == 0) + else if (g_strcmp0 (key, "Voltage") == 0) device->priv->voltage = g_value_get_double (value); - else if (g_strcmp0 (key, "time-to-full") == 0) + else if (g_strcmp0 (key, "TimeToFull") == 0) device->priv->time_to_full = g_value_get_int64 (value); - else if (g_strcmp0 (key, "time-to-empty") == 0) + else if (g_strcmp0 (key, "TimeToEmpty") == 0) device->priv->time_to_empty = g_value_get_int64 (value); - else if (g_strcmp0 (key, "percentage") == 0) + else if (g_strcmp0 (key, "Percentage") == 0) device->priv->percentage = g_value_get_double (value); - else if (g_strcmp0 (key, "technology") == 0) + else if (g_strcmp0 (key, "Technology") == 0) device->priv->technology = g_value_get_uint (value); - else if (g_strcmp0 (key, "is-present") == 0) + else if (g_strcmp0 (key, "IsPresent") == 0) device->priv->is_present = g_value_get_boolean (value); - else if (g_strcmp0 (key, "is-rechargeable") == 0) + else if (g_strcmp0 (key, "IsRechargeable") == 0) device->priv->is_rechargeable = g_value_get_boolean (value); - else if (g_strcmp0 (key, "power-supply") == 0) + else if (g_strcmp0 (key, "PowerSupply") == 0) device->priv->power_supply = g_value_get_boolean (value); - else if (g_strcmp0 (key, "capacity") == 0) + else if (g_strcmp0 (key, "Capacity") == 0) device->priv->capacity = g_value_get_double (value); - else if (g_strcmp0 (key, "state") == 0) + else if (g_strcmp0 (key, "State") == 0) device->priv->state = g_value_get_uint (value); - else if (g_strcmp0 (key, "recall-notice") == 0) + else if (g_strcmp0 (key, "RecallNotice") == 0) device->priv->recall_notice = g_value_get_boolean (value); - else if (g_strcmp0 (key, "recall-vendor") == 0) + else if (g_strcmp0 (key, "RecallVendor") == 0) device->priv->recall_vendor = g_strdup (g_value_get_string (value)); - else if (g_strcmp0 (key, "recall-url") == 0) + else if (g_strcmp0 (key, "RecallUrl") == 0) device->priv->recall_url = g_strdup (g_value_get_string (value)); else g_warning ("unhandled property '%s'", key); @@ -851,7 +851,6 @@ dkp_device_get_property (GObject *object, guint prop_id, GValue *value, GParamSp } } - /** * dkp_device_class_init: * @klass: The DkpDeviceClass diff --git a/devkit-power-gobject/dkp-wakeups.c b/devkit-power-gobject/dkp-wakeups.c index 77d43cc..1bd9f23 100644 --- a/devkit-power-gobject/dkp-wakeups.c +++ b/devkit-power-gobject/dkp-wakeups.c @@ -195,9 +195,9 @@ dkp_wakeups_ensure_properties (DkpWakeups *wakeups) goto out; } - value = g_hash_table_lookup (props, "has-capability"); + value = g_hash_table_lookup (props, "HasCapability"); if (value == NULL) { - g_warning ("No 'has-capability' property"); + g_warning ("No 'HasCapability' property"); goto out; } wakeups->priv->has_capability = g_value_get_boolean (value); diff --git a/src/org.freedesktop.DeviceKit.Power.Device.xml b/src/org.freedesktop.DeviceKit.Power.Device.xml index d6939d9..a73504d 100644 --- a/src/org.freedesktop.DeviceKit.Power.Device.xml +++ b/src/org.freedesktop.DeviceKit.Power.Device.xml @@ -257,7 +257,7 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 - + @@ -271,7 +271,7 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 - + @@ -281,7 +281,7 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 - + @@ -291,7 +291,7 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 - + @@ -301,7 +301,7 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 - + @@ -312,7 +312,7 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 - + @@ -351,7 +351,7 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 - + @@ -363,7 +363,7 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 - + @@ -373,7 +373,7 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 - + @@ -383,20 +383,20 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 - + Whether power is currently being provided through line power. This property is only valid if the property - type + type has the value "line-power". - + @@ -404,14 +404,14 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 the power source. This property is only valid if the property - type + type has the value "battery". - + @@ -419,14 +419,14 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 it's considered to be empty. This property is only valid if the property - type + type has the value "battery". - + @@ -434,14 +434,14 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 it's considered full. This property is only valid if the property - type + type has the value "battery". - + @@ -449,14 +449,14 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 designed to hold when it's considered full. This property is only valid if the property - type + type has the value "battery". - + @@ -465,14 +465,14 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 negative it's being charged. This property is only valid if the property - type + type has the value "battery". - + @@ -482,7 +482,7 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 - + @@ -490,14 +490,14 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 Is set to 0 if unknown. This property is only valid if the property - type + type has the value "battery". - + @@ -505,36 +505,36 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 Is set to 0 if unknown. This property is only valid if the property - type + type has the value "battery". - + The amount of energy left in the power source expressed as a percentage between 0 and 100. Typically this is the same as - (energy - - energy-empty) / - (energy-full - - energy-empty). + (energy - + energy-empty) / + (energy-full - + energy-empty). However, some primitive power sources are capable of only reporting percentages and in this case the energy-* properties will be unset while this property is set. This property is only valid if the property - type + type has the value "battery". - + @@ -543,14 +543,14 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 expensive UPS and most laptop batteries. This property is only valid if the property - type + type has the value "battery". - + @@ -581,28 +581,28 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 This property is only valid if the property - type + type has the value "battery". - + If the power source is rechargeable. This property is only valid if the property - type + type has the value "battery". - + @@ -610,20 +610,20 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 The capacity of the battery will reduce with age. A capacity value less than 75% is usually a sign that you should renew your battery. Typically this value is the same as - (full-design / - full) * 100. + (full-design / + full) * 100. However, some primitive power sources are not capable reporting capacity and in this case the capacity property will be unset. This property is only valid if the property - type + type has the value "battery". - + @@ -654,14 +654,14 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 This property is only valid if the property - type + type has the value "battery". - + @@ -674,7 +674,7 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 - + @@ -687,7 +687,7 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2 - + diff --git a/src/org.freedesktop.DeviceKit.Power.Wakeups.xml b/src/org.freedesktop.DeviceKit.Power.Wakeups.xml index d3e0342..27fa662 100644 --- a/src/org.freedesktop.DeviceKit.Power.Wakeups.xml +++ b/src/org.freedesktop.DeviceKit.Power.Wakeups.xml @@ -16,7 +16,7 @@ - + diff --git a/src/org.freedesktop.DeviceKit.Power.xml b/src/org.freedesktop.DeviceKit.Power.xml index f6f3df9..001cf9c 100644 --- a/src/org.freedesktop.DeviceKit.Power.xml +++ b/src/org.freedesktop.DeviceKit.Power.xml @@ -141,39 +141,39 @@ method return sender=:1.386 -> dest=:1.451 reply_serial=2 - + Version of the running daemon, e.g. 002. - + Whether the system is able to suspend. - + Whether the system is able to hibernate. - + Indicates whether the system is running on battery power. This property is provided for convenience. - + Indicates whether the system is running on battery power and if the battery is critically low. This property is provided for convenience. - + @@ -183,7 +183,7 @@ method return sender=:1.386 -> dest=:1.451 reply_serial=2 - + diff --git a/tools/dkp-tool.c b/tools/dkp-tool.c index 031e9d5..7d79311 100644 --- a/tools/dkp-tool.c +++ b/tools/dkp-tool.c @@ -210,7 +210,7 @@ main (int argc, char **argv) DkpDevice *device; const GOptionEntry entries[] = { - { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, _("Show extra debugging information"), NULL }, + { "verbose", '\0', 0, G_OPTION_ARG_NONE, &verbose, _("Show extra debugging information"), NULL }, { "enumerate", 'e', 0, G_OPTION_ARG_NONE, &opt_enumerate, _("Enumerate objects paths for devices"), NULL }, { "dump", 'd', 0, G_OPTION_ARG_NONE, &opt_dump, _("Dump all parameters for all objects"), NULL }, { "wakeups", 'w', 0, G_OPTION_ARG_NONE, &opt_wakeups, _("Get the wakeup data"), NULL },