Commit graph

34 commits

Author SHA1 Message Date
Bastien Nocera
aa62f6a15c lib: Fix possible warning when type changes
UpDevice on the daemon side has a "type" property, but the
libupower-glib object has a "kind" type instead. Translate that.
2013-10-17 23:20:22 +02:00
Bastien Nocera
3063bdaf44 lib: Fix compile-time warning 2013-10-17 14:51:07 +02:00
Bastien Nocera
0010e93251 all: Remove *changed signals
Now that we send out PropertiesChanged signals (on the daemon side)
and "notify" signals (on the client side), there's no need for the
all encompassing DeviceChanged and Changed signals.

They would have woken up any client, even if they were not interested
in receiving the signals.
2013-10-17 14:25:25 +02:00
Bastien Nocera
595d72f6b6 lib: Proxy notify changes from UpDevice glue 2013-10-17 12:37:29 +02:00
Bastien Nocera
a76eaeddb9 lib: Trim properties when printing the display device 2013-10-17 00:45:26 +02:00
Bastien Nocera
85ce906bf2 lib: Fix compilation 2013-10-15 16:04:21 +02:00
Bastien Nocera
677f2f4da7 lib: Use slices to allocate cached properties
Saves on memory fragmentation.
2013-10-15 15:51:55 +02:00
Bastien Nocera
4079ba8272 lib: Print property name when cached property doesn't exist 2013-10-15 15:51:00 +02:00
Bastien Nocera
d7d215a4b6 lib: Cache property values correctly
This is cleaner.
2013-10-15 15:50:31 +02:00
Bastien Nocera
d2484d4ec1 lib: Add support for the IconName property 2013-10-14 11:06:53 +02:00
Bastien Nocera
e0fb5078bd lib: up_device_to_text() won't work for fake devices
For now, up_device_to_text() won't work for devices that aren't
backed by a UPower device.
2013-10-14 10:42:56 +02:00
Bastien Nocera
869050d699 lib: Make it possible to create local UpDevices
gnome-settings-daemon creates a composite UpDevice that's not
backed by any real D-Bus object in UPower, so we shouldn't
try and poke the inexistant proxy in this case.

We'll cache the properties that the caller sets in this case,
but will not support sending back default/unset values.
2013-10-14 10:42:56 +02:00
Bastien Nocera
9c27c42a99 lib: Fix alignment of "online" in device dump 2013-10-14 10:42:56 +02:00
Bastien Nocera
493c2192a2 lib: Add warning-level device property 2013-10-14 10:42:56 +02:00
Bastien Nocera
b989cad776 lib: Port UpDevice to GDBus
Using the new proxy.
2013-10-14 10:42:55 +02:00
Bastien Nocera
c590354d0a lib: No need to set private members to NULL
GObject already makes sure of that for us.
2013-10-14 10:42:55 +02:00
Bastien Nocera
c842f1a53e Remove obsolete battery recall properties
The recalls for that broken batch of Sony batteries dates back from
2006. All the batteries that could have been recalled have now
been recalled, and somebody particularly interested in supporting
them can match the batteries using the old rules file, in a
user session or a separate daemon.
2013-10-14 10:42:55 +02:00
Bastien Nocera
ad7e809d4d lib: Simplify _new() functions
No need to use a temporary variable.
2013-10-14 10:37:03 +02:00
Bastien Nocera
66da41ceac lib: Add missing "element-type" introspection metadata
https://bugs.freedesktop.org/show_bug.cgi?id=55419
2013-10-14 09:58:22 +02:00
Martin Pitt
2b10e20262 Make GetHistory() array order consistent
When requesting fewer history elements than we actually have, fix the
interpolation loop to not reverse the returned elements; this already does not
happen if we request more elements than available, which led to the returned
list order depending on the history size.

Now the first array element is always the most recent one. Update documentation
accordingly.

Add test case to reproduce the problem. We now add three sample points to be
able to request a subset and still assert its correct order, and make the
charge values be further apart to ensure correct interpolation.

https://bugs.freedesktop.org/show_bug.cgi?id=68384
2013-08-29 10:44:26 +02:00
Seth Forshee
eaf86482a9 Add temperature property for batteries
Linux's power_supply class supports a temperature attribute, which is
supported by many battery drivers. Add a new property to export this
information and support this property in Linux.

https://bugs.freedesktop.org/show_bug.cgi?id=68338

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Martin Pitt <martinpitt@gnome.org>
2013-08-23 08:45:57 +02:00
Julien Danjou
2f03ad62b5 Add luminosity property
This adds the luminosity property for devices able to recharge using light.

Signed-off-by: Julien Danjou <julien@danjou.info>
Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-10-30 20:03:54 +00:00
Martin Pitt
2b216e7db3 Selectively disable warnings for deprecated GValueArray
GLib 2.33 and further deprecates GValueArray. However, we still need it as long
as we are using dbus-glib, so selectively disable the deprecation warnings for
the three functions that use GValueArray. This allows us to continue to build
with -Werror.
2012-06-14 12:52:11 +02:00
Richard Hughes
ed34986e08 libupower-glib: Reject invalid object paths to avoid asserting libdbus 2010-11-01 09:52:07 +00:00
Richard Hughes
58f3d9fbdf Fix up all the warnings when building with new versions of gobject-introspection 2010-10-05 11:13:09 +01:00
Richard Hughes
23a1694d69 Ensure the new device types get valid descriptions in upower --dump 2010-07-26 15:28:12 +01:00
Richard Hughes
29d4de79e1 Use GCancellable in libupower-glib so we can eventually get to GIO async methods without breaking future API 2010-02-05 09:41:06 +00:00
Richard Hughes
4aa5d780ce Ensure we return all lines of the UpDevice when we call up_device_to_string() 2010-02-05 09:25:08 +00:00
Richard Hughes
acfe9c3089 Update the Free Software Foundation address 2010-01-27 16:27:15 +00:00
Richard Hughes
ada609a6e5 trivial: add some more gtk-doc markup to the new objects 2010-01-26 12:15:15 +00:00
Richard Hughes
4885f802d1 trivial: add two more functions to DkpDevice for getting the stats and history 2010-01-26 12:09:26 +00:00
Richard Hughes
5e8ba54573 trivial: rename the new libupower 'type' to 'kind' to avoid clashing with GObject generated names 2010-01-26 10:53:04 +00:00
Richard Hughes
27fada20be trivial: add some gtk-doc markup into libupower-glib and hook it up to the build system 2010-01-25 16:54:17 +00:00
Richard Hughes
0a2b06f298 Add libupower so applications can switch away from devkit-power-gobject 2010-01-25 15:20:09 +00:00