Find a file
Martin Pitt 932a6a39e3 lib: Add proper error and cancellable handling to UpClient constructor
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
2016-05-18 14:58:28 +02:00
dbus Share generated code between daemon and library 2015-07-29 13:38:13 +01:00
doc Share generated code between daemon and library 2015-07-29 13:38:13 +01:00
etc etc: Update IgnoreLid documentation 2015-11-12 16:38:42 +01:00
libupower-glib lib: Add proper error and cancellable handling to UpClient constructor 2016-05-18 14:58:28 +02:00
m4 Use PIE to better secure installed tools and also use full RELRO in the daemon 2013-05-07 14:07:31 +01:00
po Remove QoS interface 2013-10-14 10:42:55 +02:00
rules Update UPower HID rules - supported devices list 2015-07-29 13:21:16 +01:00
src daemon: fix get_critical_action() 2016-02-23 09:51:07 +01:00
tools Fix build regression 2015-08-10 11:06:30 +01:00
AUTHORS trivial: add my copyright 2008-09-06 11:12:24 +01:00
autogen.sh Use upstream gettext instead the glib one 2011-07-19 12:16:30 +01:00
configure.ac trivial: post release version bump 2016-02-16 08:48:00 +00:00
COPYING trivial: Rename a few 'DeviceKit-power' strings we missed 2010-05-28 15:00:07 +01:00
git.mk Use git.mk and remove the manual .gitignore files 2011-07-19 12:40:21 +01:00
HACKING Fix links to git repository in HACKING 2010-12-27 10:26:18 +01:00
Makefile.am rules: Fix distcheck'ing not being able to install udev rules 2015-09-23 17:18:46 +02:00
NEWS Released UPower 0.99.4 2016-02-16 08:47:05 +00:00
README Update README 2016-02-17 17:01:16 +00:00
RELEASE trivial: post release version bump 2016-02-16 08:48:00 +00:00
upower-glib.pc.in lib: Remove dbus-glib from the dependencies 2013-10-14 10:42:56 +02:00

===============
UPower
===============

Requirements:

   glib-2.0             >= 2.34.0
   gio-2.0              >= 2.16.1
   gudev-1.0            >= 147    (Linux)
   libusb-1.0           >= 1.0.0  (Linux)
   libimobiledevice-1.0 >= 0.9.7  (optional)

UPower is an abstraction for enumerating power devices,
listening to device events and querying history and statistics.
Any application or service on the system can access the
org.freedesktop.UPower service via the system message bus.