| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
The generated headers for the dbus service are in the build dir, not
the source dir.
../../libupower-glib/up-client.c:39:10: fatal error: up-daemon-generated.h: No such file or directory
#include "up-daemon-generated.h"
^~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
| |
It doesn't return a UpClient.
|
| |
|
|
|
|
|
|
| |
This ensures consistent rendering.
See https://developer.gnome.org/gtk-doc-manual/stable/documenting_sections.html.en
|
|
|
|
|
|
|
|
|
|
| |
Without the braces on the same line gtk-doc adds function pointers as
functions to the documentation and fails to detect the types as
GObjects. This fixes object names in the index and cross refs.
See the examples in
https://developer.gnome.org/gtk-doc-manual/stable/documenting_symbols.html.en
|
|
|
|
|
|
| |
The existing function didn't set the free function on the GPtrArray.
This means a libupower user can easily make a mistake in the reference
counting of the array contents.
|
|
|
|
|
|
| |
And print "should be ignored" next to the percentage.
https://bugs.freedesktop.org/show_bug.cgi?id=97484
|
|
|
|
| |
Use g_clear_pointer() and g_clear_object() when possible.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When UPower would appear, or disappear, we'd get warnings like:
g_object_notify: object class 'UpDevice' has no property named 'g-name-owner'
or:
g_object_notify: object class 'UpClient' has no property named 'g-name-owner'
This was caused by the property proxying added in 7531dbd and 28438a7
being too lax about which properties it tried to proxy, which included
ones that didn't apply to the object types in question.
See https://bugs.freedesktop.org/show_bug.cgi?id=43001
https://bugs.freedesktop.org/show_bug.cgi?id=102350
|
|
|
|
| |
https://bugs.freedesktop.org/show_bug.cgi?id=103361
|
|
|
|
|
| |
One was referencing a non-existent enum member, the other was
missing a link altogether.
|
|
|
|
|
|
|
|
| |
Joypads, joysticks, dance mats, paddles, Wiimotes, steering wheels,
tractor cabin simulators, pedals, yokes, breathing controllers, and,
hmm, etc.
https://bugs.freedesktop.org/show_bug.cgi?id=102493
|
|
|
|
|
|
|
|
|
|
|
| |
We don't need to protect against NULL values, we already do at the start
of the function.
Created with:
:%s,g_strcmp0\(.*\) == 0,g_str_equal \1,
Mentioned in:
https://bugs.freedesktop.org/show_bug.cgi?id=100359#c14
|
|
|
|
|
|
|
|
|
|
| |
Export approximate battery levels that devices can use, exported by
the kernel as POWER_SUPPLY_CAPACITY_LEVEL_* values.
This avoids bizarrely accurate values showing up in UIs when we only
have ok/warning levels of accuracy in some cases.
https://bugs.freedesktop.org/show_bug.cgi?id=100359
|
|
|
|
|
|
|
|
|
|
| |
Those levels will not be used to cover warning levels, but approximate
battery levels that devices can use, exported by the kernel as
POWER_SUPPLY_CAPACITY_LEVEL_* values.
See linux/power_supply.h
https://bugs.freedesktop.org/show_bug.cgi?id=100359
|
|
|
|
| |
The strings are user visible strings, so this isn't a y2k problem.
|
|
|
|
|
|
|
|
|
|
| |
GObject _new constructors should always return a new pointer and not do
anything else than g_{object,initable}_new(). Drop the internal
up_client_object singleton instance.
This simplifies the code and makes the code robust with multiple threads.
Side issue in https://bugs.freedesktop.org/show_bug.cgi?id=95350
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A GObject's _init() should never fail or block, but this is currently the case
as up_client_init() connects to upowerd on D-Bus. Convert this to the GInitable
interface and provide a new constructor up_client_new_full() which accepts a
GCancellable and GError, so that clients can do proper error handling
and reporting.
This changes up_client_new() to return NULL when connecting to upowerd fails.
This provides a more well-defined behaviour in this case as clients can check
for this and our methods stop segfaulting as they have checks like
g_return_val_if_fail (UP_IS_CLIENT (client), ...)
Previously we returned a valid object, but trying to call any method on it
segfaulted due to the NULL D-Bus proxy, so client code had no chance to check
whether the UpClient object was really valid.
https://bugs.freedesktop.org/show_bug.cgi?id=95350
|
|
|
|
|
|
|
|
| |
This allows using e.g. g_autoptr(UpDevice) in other programs, but does
not make upower itself use g_autoptr, or require a new enough glib to
support it.
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
|
|
|
| |
Since we use the same GDBus code in libupower-glib and the daemon,
auto-generate a private library that can be used by both.
|
|
|
|
|
| |
When up_client_get_devices() fails to contact the D-Bus daemon, don't
leak the newly created array.
|
|
|
|
|
|
|
|
|
| |
Initialize the GVariant* pointers, so that they aren't uninitialized when
jumping to "out:" and unref'ing them.
https://bugs.freedesktop.org/show_bug.cgi?id=89476
https://bugs.debian.org/774546
https://bugs.launchpad.net/ubuntu-mate/+bug/1428337
|
| |
|
|
|
|
|
|
|
| |
Removes the deprecated (for not very long) property, before we do a 1.0
release.
https://bugs.freedesktop.org/show_bug.cgi?id=78380
|
| |
|
| |
|
|
|
|
| |
Missing colon.
|
|
|
|
|
| |
This fixes "upower --version" when the daemon is not running, and thus the
client proxy is NULL.
|
|
|
|
|
| |
UpDevice on the daemon side has a "type" property, but the
libupower-glib object has a "kind" type instead. Translate that.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
And make device-removed send an object path, not a UpDevice.
This means that we don't keep all the remote devices as local
UpDevices object, getting woken up any time any of them have a
property changed, without anybody listening.
This should greatly cut down on the wakeups on the client side,
especially for applications that only use a small portion of the API
like the "on-battery" or "warning-level" properties.
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
This allows desktop front-ends to get which action will
actually be taken when we hit critical battery.
This is not a property as availability of actions might
change over the course of the run of the system, and
we didn't want to make unnecessary D-Bus calls on startup.
|
|
|
|
|
|
| |
The WarningLevel property just replicated the warning level
on the display device, or at least should have. So we fix the latter
to remove the former.
|
| |
|
|
|
|
| |
Add a helper to get to the display device.
|
|
|
|
|
| |
It doesn't do anything, and we already broke the ABI by removing
some functions, so remove this as well.
|
| |
|
|
|
|
| |
Saves on memory fragmentation.
|
| |
|
|
|
|
| |
This is cleaner.
|
|
|
|
|
|
| |
When UPSes are discharging, we should have a warning already, as
it means that mains power has been lost to the UPS (though not
to the computer).
|
| |
|
|
|
|
|
|
| |
In the UpClient object.
https://bugs.freedesktop.org/show_bug.cgi?id=43001
|
|
|
|
|
| |
For now, up_device_to_text() won't work for devices that aren't
backed by a UPower device.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Remove on-low-battery and add warning-level daemon properties.
|