Commit 322513b0 authored by David Zeuthen's avatar David Zeuthen

PolkitAuthority: Implement failable initialization

... and deprecate polkit_authority_get(). Also fix up locking in
PolkitAuthority.
Signed-off-by: default avatarDavid Zeuthen <davidz@redhat.com>
parent f23aeb68
......@@ -21,7 +21,9 @@ POLKIT_UNIX_USER_GET_CLASS
PolkitAuthority
PolkitAuthorityFeatures
PolkitCheckAuthorizationFlags
polkit_authority_get
polkit_authority_get_sync
polkit_authority_get_async
polkit_authority_get_finish
polkit_authority_get_owner
polkit_authority_get_backend_name
polkit_authority_get_backend_version
......
This diff is collapsed.
......@@ -47,7 +47,15 @@ typedef struct _PolkitAuthorityClass PolkitAuthorityClass;
GType polkit_authority_get_type (void) G_GNUC_CONST;
PolkitAuthority *polkit_authority_get (void);
PolkitAuthority *polkit_authority_get (void) G_GNUC_DEPRECATED_FOR (polkit_authority_get_sync);
void polkit_authority_get_async (GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
PolkitAuthority *polkit_authority_get_finish (GAsyncResult *res,
GError **error);
PolkitAuthority *polkit_authority_get_sync (GCancellable *cancellable,
GError **error);
gchar *polkit_authority_get_owner (PolkitAuthority *authority);
const gchar *polkit_authority_get_backend_name (PolkitAuthority *authority);
......
......@@ -408,8 +408,9 @@ polkit_permission_initable_init (GInitable *initable,
ret = FALSE;
/* TODO: use sync failable getter instead */
permission->authority = polkit_authority_get ();
permission->authority = polkit_authority_get_sync (cancellable, error);
if (permission->authority == NULL)
goto out;
g_signal_connect (permission->authority,
"changed",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment