We were manually handling the created divers/actions objects, but we did
did not cover all the cases we needed to unref them, leading to a leak.
To prevent this, use autopointers that will make everything easier to
handle.
We did terminate the daemon and waited for it, but we did not ensure
that it was terminated with no error.
This is particularly a problem when we are running the sanitizers or
valgrind, because we didn't catch any error.
Thus... We were living with some leaks that we never caught :)
This implies a SIGTERM, and so will trigger the daemon clean teardown,
making it exit correctly.
In this way the coverage data is correctly generated, making finally our
coverage reports to be real!
Fixes: #137
In case we get a SIGINT or SIGTERM signal, quit the main loop so that we
perform all the teardown operations, including notifying clients and cleaning
up all the allocated resources.
It can be useful to inspect the daemon logs in any case, so let's show
the logs details when running in meson.
Then it's up to use the `--verbose` parameter to decide whether to see
them or to inspect them from the generated logs.
Daemon may take some moments to do IO operations, and the tests
may be too fast in reading this.
As per previous cleanups this become a problem when testing in
slower scenarios (as valgrind), so take the opportunity to
cleanup the tests so that we always wait for file contents to
match the expected one.
Some clients (notably GNOME) look specifically for both the path and
interface. To avoid breaking them on profile change events make sure
to emit signals on both the legacy and modern interface.
Some systems have multiple GPUs with an eDP output but the panel
isn't connected to all of them (or it's controlled by a mux).
Handle this case by ensuring that the panel is connected when
before writing an attribute.
Expose the daemon as 'org.freedesktop.UPower.PowerProfiles' by default
but we also own the old 'net.hadess.PowerProfiles' name for
compatibility resons.
Also dbus objects are now registered also in the path
/org/freedesktop/UPower/PowerProfiles and they implement the
org.freedesktop.UPower.PowerProfiles interface.
Even in this case we preserve the compatibility with the old ones.
To make this switch as most reliable as possible, the code is now
generated for dbus configuration files preserving the previous ones as
base.
Tests are now performed checking both names, to ensure again that we're
not breaking the expectations for the old APIs consumers.
It's still quite old, but provides some features we may want to use in
future, so let's use a newer version since we're about to release a new
major version of p-p-d too.
Some distros as LTS ones may still have old versions of polkit
gobject.
Since we only depend on the new polkit because of auto-pointers,
let's add a tiny compatibility layer to make possible to get
p-p-d also working on older stable distros as OEMs may like.
Remove a lot of the unnecessary stuff about the process, and instead
pad out the domain to make it more accessible.
If running on an interactive terminal add color coding for warnings
and errors. If this behavior is not desirable for an interactive terminal,
NO_COLOR=0 can be set in the environment.