mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-18 13:48:21 +02:00
lib: Add up_client_new_session()
To create a UpClient that will listen on the session bus.
This commit is contained in:
parent
6a8715ce98
commit
3e3fa04ffb
2 changed files with 18 additions and 0 deletions
|
|
@ -611,3 +611,20 @@ up_client_new (void)
|
|||
return client;
|
||||
}
|
||||
|
||||
/**
|
||||
* up_client_new_session:
|
||||
*
|
||||
* Creates a new #UpClient object that will listen to UPower data on the session
|
||||
* bus rather than on the system bus.
|
||||
*
|
||||
* Return value: a new UpClient object, or %NULL on failure.
|
||||
*
|
||||
* Since: 0.9.11
|
||||
**/
|
||||
UpClient *
|
||||
up_client_new_session (GCancellable *cancellable, GError **error)
|
||||
{
|
||||
return g_initable_new (UP_TYPE_CLIENT, cancellable, error,
|
||||
"bus-type", G_BUS_TYPE_SESSION,
|
||||
NULL);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ typedef struct {
|
|||
GType up_client_get_type (void);
|
||||
UpClient *up_client_new (void);
|
||||
UpClient *up_client_new_full (GCancellable *cancellable, GError **error);
|
||||
UpClient *up_client_new_session (GCancellable *cancellable, GError **error);
|
||||
|
||||
/* sync versions */
|
||||
UpDevice * up_client_get_display_device (UpClient *client);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue