PolicyKit: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Mon Aug 9 11:48:27 PDT 2010


 src/polkit/Makefile.am                    |    1 
 src/polkit/polkitactiondescription.c      |   14 ++--
 src/polkit/polkitauthority.c              |   85 +++++++++++++++---------------
 src/polkit/polkitauthorizationresult.c    |   12 ++--
 src/polkit/polkitdetails.c                |    7 +-
 src/polkit/polkiterror.h                  |    2 
 src/polkit/polkitidentity.c               |    4 -
 src/polkit/polkitpermission.c             |   16 ++---
 src/polkit/polkitsubject.c                |   10 +--
 src/polkit/polkitsystembusname.c          |    7 +-
 src/polkit/polkittemporaryauthorization.c |   14 ----
 src/polkit/polkitunixgroup.c              |    3 -
 src/polkit/polkitunixprocess.c            |    2 
 src/polkit/polkitunixsession.c            |   16 +++--
 src/polkit/polkitunixuser.c               |    2 
 15 files changed, 96 insertions(+), 99 deletions(-)

New commits:
commit 84a9cd170fecacb8373e3ab2290be8975f59cb57
Author: David Zeuthen <davidz at redhat.com>
Date:   Mon Aug 9 14:48:10 2010 -0400

    Update GI annotations
    
    Signed-off-by: David Zeuthen <davidz at redhat.com>

diff --git a/src/polkit/Makefile.am b/src/polkit/Makefile.am
index a2410b0..4afd4ee 100644
--- a/src/polkit/Makefile.am
+++ b/src/polkit/Makefile.am
@@ -129,6 +129,7 @@ Polkit-1.0.gir: libpolkit-gobject-1.la $(G_IR_SCANNER) Makefile.am
 		$(srcdir)/polkitunixprocess.h 			\
 		$(srcdir)/polkitunixsession.h 			\
 		$(srcdir)/polkitunixuser.h 			\
+		$(srcdir)/polkitpermission.h 			\
 		$(NULL)
 
 Polkit-1.0.typelib: Polkit-1.0.gir $(G_IR_COMPILER)
diff --git a/src/polkit/polkitactiondescription.c b/src/polkit/polkitactiondescription.c
index dc99ffc..6930cc4 100644
--- a/src/polkit/polkitactiondescription.c
+++ b/src/polkit/polkitactiondescription.c
@@ -152,8 +152,7 @@ polkit_action_description_get_message (PolkitActionDescription *action_descripti
  *
  * Gets the vendor name for @action_description, if any.
  *
- * Returns: %NULL if there is no vendor, otherwise a string owned by
- * @action_description. Do not free.
+ * Returns: A string owned by @action_description. Do not free.
  */
 const gchar  *
 polkit_action_description_get_vendor_name (PolkitActionDescription *action_description)
@@ -168,8 +167,7 @@ polkit_action_description_get_vendor_name (PolkitActionDescription *action_descr
  *
  * Gets the vendor URL for @action_description, if any.
  *
- * Returns: %NULL if there is no vendor URL, otherwise a string owned
- * by @action_description. Do not free.
+ * Returns: A string owned by @action_description. Do not free.
  */
 const gchar  *
 polkit_action_description_get_vendor_url (PolkitActionDescription *action_description)
@@ -233,8 +231,7 @@ polkit_action_description_get_implicit_active (PolkitActionDescription *action_d
  *
  * Gets the icon name for @action_description, if any.
  *
- * Returns: %NULL if there is no icon for @action, otherwise the icon
- * name owned by @action_description. Do not free.
+ * Returns: A string owned by @action_description. Do not free.
  */
 const gchar *
 polkit_action_description_get_icon_name (PolkitActionDescription *action_description)
@@ -250,8 +247,9 @@ polkit_action_description_get_icon_name (PolkitActionDescription *action_descrip
  *
  * Get the value of the annotation with @key.
  *
- * Returns: %NULL if there is no annoation with @key, otherwise the
- * annotation value owned by @action_description. Do not free.
+ * Returns: (allow-none): %NULL if there is no annoation with @key,
+ * otherwise the annotation value owned by @action_description. Do not
+ * free.
  */
 const gchar *
 polkit_action_description_get_annotation (PolkitActionDescription *action_description,
diff --git a/src/polkit/polkitauthority.c b/src/polkit/polkitauthority.c
index ed0f465..f9f3971 100644
--- a/src/polkit/polkitauthority.c
+++ b/src/polkit/polkitauthority.c
@@ -369,6 +369,7 @@ async_initable_iface_init (GAsyncInitableIface *async_initable_iface)
 
 /* ---------------------------------------------------------------------------------------------------- */
 
+/* deprecated, see polkitauthority.h */
 PolkitAuthority *
 polkit_authority_get (void)
 {
@@ -441,7 +442,7 @@ authority_get_async_cb (GObject      *source_object,
 
 /**
  * polkit_authority_get_async:
- * @cancellable: A #GCancellable or %NULL.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
  * @user_data: The data to pass to @callback.
  *
@@ -491,7 +492,7 @@ polkit_authority_get_async  (GCancellable        *cancellable,
 /**
  * polkit_authority_get_finish:
  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to polkit_authority_get_async().
- * @error: Return location for error or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Finishes an operation started with polkit_authority_get_async().
  *
@@ -528,8 +529,8 @@ polkit_authority_get_finish (GAsyncResult        *res,
 
 /**
  * polkit_authority_get_sync:
- * @cancellable: A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Synchronously gets a reference to the authority.
  *
@@ -626,7 +627,7 @@ generic_async_cb (GObject      *source_obj,
 /**
  * polkit_authority_enumerate_actions:
  * @authority: A #PolkitAuthority.
- * @cancellable: A #GCancellable or %NULL.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
  * @user_data: The data to pass to @callback.
  *
@@ -662,7 +663,7 @@ polkit_authority_enumerate_actions (PolkitAuthority     *authority,
  * polkit_authority_enumerate_actions_finish:
  * @authority: A #PolkitAuthority.
  * @res: A #GAsyncResult obtained from the callback.
- * @error: Return location for error or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Finishes retrieving all registered actions.
  *
@@ -713,8 +714,8 @@ polkit_authority_enumerate_actions_finish (PolkitAuthority *authority,
 /**
  * polkit_authority_enumerate_actions_sync:
  * @authority: A #PolkitAuthority.
- * @cancellable: A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Synchronously retrieves all registered actions.
  *
@@ -826,10 +827,11 @@ check_authorization_cb (GDBusProxy    *proxy,
  * @authority: A #PolkitAuthority.
  * @subject: A #PolkitSubject.
  * @action_id: The action to check for.
- * @details: Details about the action or %NULL. Keys starting with <literal>polkit.</literal> are reserved
- * for internal use and cannot be used.
+ * @details: (allow-none): Details about the action or %NULL. Keys
+ * starting with <literal>polkit.</literal> are reserved for internal
+ * use and cannot be used.
  * @flags: A set of #PolkitCheckAuthorizationFlags.
- * @cancellable: A #GCancellable or %NULL.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
  * @user_data: The data to pass to @callback.
  *
@@ -902,7 +904,7 @@ polkit_authority_check_authorization (PolkitAuthority               *authority,
  * polkit_authority_check_authorization_finish:
  * @authority: A #PolkitAuthority.
  * @res: A #GAsyncResult obtained from the callback.
- * @error: Return location for error or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Finishes checking if a subject is authorized for an action.
  *
@@ -935,11 +937,12 @@ polkit_authority_check_authorization_finish (PolkitAuthority          *authority
  * @authority: A #PolkitAuthority.
  * @subject: A #PolkitSubject.
  * @action_id: The action to check for.
- * @details: Details about the action or %NULL. Keys starting with <literal>polkit.</literal> are reserved
- * for internal use and cannot be used.
+ * @details: (allow-none): Details about the action or %NULL. Keys
+ * starting with <literal>polkit.</literal> are reserved for internal
+ * use and cannot be used.
  * @flags: A set of #PolkitCheckAuthorizationFlags.
- * @cancellable: A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Checks if @subject is authorized to perform the action represented by @action_id.
  *
@@ -986,7 +989,7 @@ polkit_authority_check_authorization_sync (PolkitAuthority               *author
  * @subject: The subject the authentication agent is for, typically a #PolkitUnixSession object.
  * @locale: The locale of the authentication agent.
  * @object_path: The object path for the authentication agent.
- * @cancellable: A #GCancellable or %NULL.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
  * @user_data: The data to pass to @callback.
  *
@@ -1036,7 +1039,7 @@ polkit_authority_register_authentication_agent (PolkitAuthority      *authority,
  * polkit_authority_register_authentication_agent_finish:
  * @authority: A #PolkitAuthority.
  * @res: A #GAsyncResult obtained from the callback.
- * @error: Return location for error or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Finishes registering an authentication agent.
  *
@@ -1077,8 +1080,8 @@ polkit_authority_register_authentication_agent_finish (PolkitAuthority *authorit
  * @subject: The subject the authentication agent is for, typically a #PolkitUnixSession object.
  * @locale: The locale of the authentication agent.
  * @object_path: The object path for the authentication agent.
- * @cancellable: A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Registers an authentication agent.
  *
@@ -1119,7 +1122,7 @@ polkit_authority_register_authentication_agent_sync (PolkitAuthority     *author
  * @subject: The subject the authentication agent is for, typically a #PolkitUnixSession object.
  * @locale: The locale of the authentication agent.
  * @object_path: The object path for the authentication agent.
- * @cancellable: A #GCancellable or %NULL.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
  * @user_data: The data to pass to @callback.
  *
@@ -1166,7 +1169,7 @@ polkit_authority_unregister_authentication_agent (PolkitAuthority      *authorit
  * polkit_authority_unregister_authentication_agent_finish:
  * @authority: A #PolkitAuthority.
  * @res: A #GAsyncResult obtained from the callback.
- * @error: Return location for error or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Finishes unregistering an authentication agent.
  *
@@ -1207,8 +1210,8 @@ polkit_authority_unregister_authentication_agent_finish (PolkitAuthority *author
  * @subject: The subject the authentication agent is for, typically a #PolkitUnixSession object.
  * @locale: The locale of the authentication agent.
  * @object_path: The object path for the authentication agent.
- * @cancellable: A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Unregisters an authentication agent.
  *
@@ -1246,7 +1249,7 @@ polkit_authority_unregister_authentication_agent_sync (PolkitAuthority     *auth
  * @authority: A #PolkitAuthority.
  * @cookie: The cookie passed to the authentication agent from the authority.
  * @identity: The identity that was authenticated.
- * @cancellable: A #GCancellable or %NULL.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
  * @user_data: The data to pass to @callback.
  *
@@ -1297,7 +1300,7 @@ polkit_authority_authentication_agent_response (PolkitAuthority      *authority,
  * polkit_authority_authentication_agent_response_finish:
  * @authority: A #PolkitAuthority.
  * @res: A #GAsyncResult obtained from the callback.
- * @error: Return location for error or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Finishes providing response from an authentication agent.
  *
@@ -1337,8 +1340,8 @@ polkit_authority_authentication_agent_response_finish (PolkitAuthority *authorit
  * @authority: A #PolkitAuthority.
  * @cookie: The cookie passed to the authentication agent from the authority.
  * @identity: The identity that was authenticated.
- * @cancellable: A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Provide response that @identity successfully authenticated for the
  * authentication request identified by @cookie. See polkit_authority_authentication_agent_response()
@@ -1377,7 +1380,7 @@ polkit_authority_authentication_agent_response_sync (PolkitAuthority     *author
  * polkit_authority_enumerate_temporary_authorizations:
  * @authority: A #PolkitAuthority.
  * @subject: A #PolkitSubject, typically a #PolkitUnixSession.
- * @cancellable: A #GCancellable or %NULL.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
  * @user_data: The data to pass to @callback.
  *
@@ -1421,7 +1424,7 @@ polkit_authority_enumerate_temporary_authorizations (PolkitAuthority     *author
  * polkit_authority_enumerate_temporary_authorizations_finish:
  * @authority: A #PolkitAuthority.
  * @res: A #GAsyncResult obtained from the callback.
- * @error: Return location for error or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Finishes retrieving all registered actions.
  *
@@ -1481,8 +1484,8 @@ polkit_authority_enumerate_temporary_authorizations_finish (PolkitAuthority *aut
  * polkit_authority_enumerate_temporary_authorizations_sync:
  * @authority: A #PolkitAuthority.
  * @subject: A #PolkitSubject, typically a #PolkitUnixSession.
- * @cancellable: A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Synchronousky gets all temporary authorizations for @subject.
  *
@@ -1518,7 +1521,7 @@ polkit_authority_enumerate_temporary_authorizations_sync (PolkitAuthority     *a
  * polkit_authority_revoke_temporary_authorizations:
  * @authority: A #PolkitAuthority.
  * @subject: The subject to revoke authorizations from, typically a #PolkitUnixSession.
- * @cancellable: A #GCancellable or %NULL.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
  * @user_data: The data to pass to @callback.
  *
@@ -1562,7 +1565,7 @@ polkit_authority_revoke_temporary_authorizations (PolkitAuthority     *authority
  * polkit_authority_revoke_temporary_authorizations_finish:
  * @authority: A #PolkitAuthority.
  * @res: A #GAsyncResult obtained from the callback.
- * @error: Return location for error or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Finishes revoking temporary authorizations.
  *
@@ -1600,8 +1603,8 @@ polkit_authority_revoke_temporary_authorizations_finish (PolkitAuthority *author
  * polkit_authority_revoke_temporary_authorizations_sync:
  * @authority: A #PolkitAuthority.
  * @subject: The subject to revoke authorizations from, typically a #PolkitUnixSession.
- * @cancellable: A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Synchronously revokes all temporary authorization from @subject.
  *
@@ -1636,7 +1639,7 @@ polkit_authority_revoke_temporary_authorizations_sync (PolkitAuthority     *auth
  * polkit_authority_revoke_temporary_authorization_by_id:
  * @authority: A #PolkitAuthority.
  * @id: The opaque identifier for the temporary authorization.
- * @cancellable: A #GCancellable or %NULL.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
  * @user_data: The data to pass to @callback.
  *
@@ -1675,7 +1678,7 @@ polkit_authority_revoke_temporary_authorization_by_id (PolkitAuthority     *auth
  * polkit_authority_revoke_temporary_authorization_by_id_finish:
  * @authority: A #PolkitAuthority.
  * @res: A #GAsyncResult obtained from the callback.
- * @error: Return location for error or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Finishes revoking a temporary authorization by id.
  *
@@ -1713,8 +1716,8 @@ polkit_authority_revoke_temporary_authorization_by_id_finish (PolkitAuthority *a
  * polkit_authority_revoke_temporary_authorization_by_id_sync:
  * @authority: A #PolkitAuthority.
  * @id: The opaque identifier for the temporary authorization.
- * @cancellable: A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Synchronously revokes a temporary authorization.
  *
@@ -1754,7 +1757,7 @@ polkit_authority_revoke_temporary_authorization_by_id_sync (PolkitAuthority
  * currently owns the name. You may connect to the #GObject::notify
  * signal to track changes to the #PolkitAuthority::owner property.
  *
- * Returns: %NULL or a string that should be freed with g_free().
+ * Returns: (allow-none): %NULL or a string that should be freed with g_free().
  **/
 gchar *
 polkit_authority_get_owner (PolkitAuthority *authority)
diff --git a/src/polkit/polkitauthorizationresult.c b/src/polkit/polkitauthorizationresult.c
index 00396b2..7390a9d 100644
--- a/src/polkit/polkitauthorizationresult.c
+++ b/src/polkit/polkitauthorizationresult.c
@@ -93,7 +93,7 @@ polkit_authorization_result_class_init (PolkitAuthorizationResultClass *klass)
  * @is_challenge: Whether the subject is authorized if more
  * information is provided. Must be %FALSE unless @is_authorized is
  * %TRUE.
- * @details: Must be %NULL unless @is_authorized is %TRUE
+ * @details: (allow-none): Must be %NULL unless @is_authorized is %TRUE
  *
  * Creates a new #PolkitAuthorizationResult object.
  *
@@ -155,8 +155,9 @@ polkit_authorization_result_get_is_challenge (PolkitAuthorizationResult *result)
  *
  * Gets the details about the result.
  *
- * Returns: A #PolkitDetails object. This object is owned by @result
- * and should not be freed by the caller.
+ * Returns: (allow-none) (transfer none): A #PolkitDetails object or
+ * %NULL if there are no details. This object is owned by @result and
+ * should not be freed by the caller.
  */
 PolkitDetails *
 polkit_authorization_result_get_details (PolkitAuthorizationResult *result)
@@ -217,8 +218,9 @@ polkit_authorization_result_get_retains_authorization (PolkitAuthorizationResult
  * This method simply reads the value of the key/value pair in @details with the
  * key <literal>polkit.temporary_authorization_id</literal>.
  *
- * Returns: The opaque temporary authorization id for @result or %NULL if not
- *    available. Do not free this string, it is owned by @result.
+ * Returns: (allow-none): The opaque temporary authorization id for
+ *    @result or %NULL if not available. Do not free this string, it
+ *    is owned by @result.
  */
 const gchar *
 polkit_authorization_result_get_temporary_authorization_id (PolkitAuthorizationResult *result)
diff --git a/src/polkit/polkitdetails.c b/src/polkit/polkitdetails.c
index 9770191..4f6555d 100644
--- a/src/polkit/polkitdetails.c
+++ b/src/polkit/polkitdetails.c
@@ -121,7 +121,7 @@ polkit_details_new_for_hash (GHashTable *hash)
  *
  * Gets the value for @key on @details.
  *
- * Returns: %NULL if there is no value for @key, otherwise a string owned by @details.
+ * Returns: (allow-none): %NULL if there is no value for @key, otherwise a string owned by @details.
  */
 const gchar *
 polkit_details_lookup (PolkitDetails *details,
@@ -139,7 +139,7 @@ polkit_details_lookup (PolkitDetails *details,
  * polkit_details_insert:
  * @details: A #PolkitDetails.
  * @key: A key.
- * @value: A value.
+ * @value: (allow-none): A value.
  *
  * Inserts a copy of @key and @value on @details.
  */
@@ -164,7 +164,8 @@ polkit_details_insert (PolkitDetails *details,
  *
  * Gets a list of all keys on @details.
  *
- * Returns: An array of strings that should be freed with g_strfreev().
+ * Returns: (allow-none): %NULL if there are no keys otherwise an
+ * array of strings that should be freed with g_strfreev().
  */
 gchar **
 polkit_details_get_keys (PolkitDetails *details)
diff --git a/src/polkit/polkiterror.h b/src/polkit/polkiterror.h
index 733c9a6..b31583d 100644
--- a/src/polkit/polkiterror.h
+++ b/src/polkit/polkiterror.h
@@ -36,7 +36,7 @@ G_BEGIN_DECLS
  * Error domain for errors when using PolicyKit. Errors in this domain will be from the #PolkitError
  * enumeration. See #GError for information on error domains
  */
-#define POLKIT_ERROR polkit_error_quark()
+#define POLKIT_ERROR (polkit_error_quark())
 
 GQuark polkit_error_quark (void);
 
diff --git a/src/polkit/polkitidentity.c b/src/polkit/polkitidentity.c
index 599056c..413b41f 100644
--- a/src/polkit/polkitidentity.c
+++ b/src/polkit/polkitidentity.c
@@ -137,8 +137,8 @@ polkit_identity_to_string (PolkitIdentity *identity)
  * Creates an object from @str that implements the #PolkitIdentity
  * interface.
  *
- * Returns: A #PolkitIdentity or %NULL if @error is set. Free with
- * g_object_unref().
+ * Returns: (allow-none): A #PolkitIdentity or %NULL if @error is
+ * set. Free with g_object_unref().
  */
 PolkitIdentity *
 polkit_identity_from_string  (const gchar   *str,
diff --git a/src/polkit/polkitpermission.c b/src/polkit/polkitpermission.c
index 7c54df5..996ee11 100644
--- a/src/polkit/polkitpermission.c
+++ b/src/polkit/polkitpermission.c
@@ -248,8 +248,8 @@ polkit_permission_class_init (PolkitPermissionClass *class)
 /**
  * polkit_permission_new:
  * @action_id: The PolicyKit action identifier.
- * @subject: A #PolkitSubject or %NULL for the current process.
- * @cancellable: A #GCancellable or %NULL.
+ * @subject: (allow-none): A #PolkitSubject or %NULL for the current process.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
  * @user_data: The data to pass to @callback.
  *
@@ -287,7 +287,7 @@ polkit_permission_new (const gchar         *action_id,
 /**
  * polkit_permission_new_finish:
  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to polkit_permission_new().
- * @error: Return location for error or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Finishes an operation started with polkit_permission_new().
  *
@@ -318,9 +318,9 @@ polkit_permission_new_finish (GAsyncResult  *res,
 /**
  * polkit_permission_new_sync:
  * @action_id: The PolicyKit action identifier.
- * @subject: A #PolkitSubject or %NULL for the current process.
- * @cancellable: A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
+ * @subject: (allow-none): A #PolkitSubject or %NULL for the current process.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Creates a #GPermission instance for the PolicyKit action
  * @action_id.
@@ -381,12 +381,12 @@ polkit_permission_get_action_id (PolkitPermission *permission)
 }
 
 /**
- * polkit_permission_get_action_id:
+ * polkit_permission_get_subject:
  * @permission: A #PolkitPermission.
  *
  * Gets the subject used for @permission.
  *
- * Returns: An object owned by @permission. Do not free.
+ * Returns: (transfer none): An object owned by @permission. Do not free.
  */
 PolkitSubject *
 polkit_permission_get_subject   (PolkitPermission    *permission)
diff --git a/src/polkit/polkitsubject.c b/src/polkit/polkitsubject.c
index 40ef2e9..19d60b9 100644
--- a/src/polkit/polkitsubject.c
+++ b/src/polkit/polkitsubject.c
@@ -133,7 +133,7 @@ polkit_subject_to_string (PolkitSubject *subject)
 /**
  * polkit_subject_exists:
  * @subject: A #PolkitSubject.
- * @cancellable: A #GCancellable or %NULL.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
  * @callback: A #GAsyncReadyCallback to call when the request is satisfied
  * @user_data: The data to pass to @callback.
  *
@@ -161,7 +161,7 @@ polkit_subject_exists (PolkitSubject       *subject,
  * polkit_subject_exists_finish:
  * @subject: A #PolkitSubject.
  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to polkit_subject_exists().
- * @error: Return location for error or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Finishes checking whether a subject exists.
  *
@@ -183,8 +183,8 @@ polkit_subject_exists_finish (PolkitSubject   *subject,
 /**
  * polkit_subject_exists_sync:
  * @subject: A #PolkitSubject.
- * @cancellable: A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Checks if @subject exists.
  *
@@ -209,7 +209,7 @@ polkit_subject_exists_sync   (PolkitSubject  *subject,
 /**
  * polkit_subject_from_string:
  * @str: A string obtained from polkit_subject_to_string().
- * @error: Return location for error.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Creates an object from @str that implements the #PolkitSubject
  * interface.
diff --git a/src/polkit/polkitsystembusname.c b/src/polkit/polkitsystembusname.c
index 562acf5..9bd074b 100644
--- a/src/polkit/polkitsystembusname.c
+++ b/src/polkit/polkitsystembusname.c
@@ -195,6 +195,7 @@ polkit_system_bus_name_set_name (PolkitSystemBusName *system_bus_name,
 PolkitSubject *
 polkit_system_bus_name_new (const gchar *name)
 {
+  g_return_val_if_fail (g_dbus_is_unique_name (name), NULL);
   return POLKIT_SUBJECT (g_object_new (POLKIT_TYPE_SYSTEM_BUS_NAME,
                                        "name", name,
                                        NULL));
@@ -342,12 +343,12 @@ subject_iface_init (PolkitSubjectIface *subject_iface)
 /**
  * polkit_system_bus_name_get_process_sync:
  * @system_bus_name: A #PolkitSystemBusName.
- * @cancellable: A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Synchronously gets a #PolkitUnixProcess object for @system_bus_name.
  *
- * Returns: A #PolkitUnixProcess object or %NULL if @error is set.
+ * Returns: (allow-none): A #PolkitUnixProcess object or %NULL if @error is set.
  **/
 PolkitSubject *
 polkit_system_bus_name_get_process_sync (PolkitSystemBusName  *system_bus_name,
diff --git a/src/polkit/polkittemporaryauthorization.c b/src/polkit/polkittemporaryauthorization.c
index 996cbed..b15202d 100644
--- a/src/polkit/polkittemporaryauthorization.c
+++ b/src/polkit/polkittemporaryauthorization.c
@@ -86,18 +86,6 @@ polkit_temporary_authorization_class_init (PolkitTemporaryAuthorizationClass *kl
   gobject_class->finalize = polkit_temporary_authorization_finalize;
 }
 
-/**
- * polkit_temporary_authorization_new:
- * @id: Id for temporary authorization
- * @action_id: An action id.
- * @subject: A #PolkitSubject.
- * @time_obtained: Time obtained, since the Epoch Jan 1, 1970 0:00 UTC.
- * @time_expires: Time the temporary authorization will expire, since the Epoch Jan 1, 1970 0:00 UTC.
- *
- * Creates a new temporary authorization.
- *
- * Returns: A #PolkitTemporaryAuthorization, free with g_object_unref()
- **/
 PolkitTemporaryAuthorization *
 polkit_temporary_authorization_new (const gchar                  *id,
                                     const gchar                  *action_id,
@@ -151,7 +139,7 @@ polkit_temporary_authorization_get_action_id (PolkitTemporaryAuthorization *auth
  *
  * Gets the subject that @authorization is for.
  *
- * Returns: A #PolkitSubject, free with g_object_unref().
+ * Returns: (transfer full): A #PolkitSubject, free with g_object_unref().
  **/
 PolkitSubject *
 polkit_temporary_authorization_get_subject (PolkitTemporaryAuthorization *authorization)
diff --git a/src/polkit/polkitunixgroup.c b/src/polkit/polkitunixgroup.c
index 53cd261..c9838e5 100644
--- a/src/polkit/polkitunixgroup.c
+++ b/src/polkit/polkitunixgroup.c
@@ -196,7 +196,8 @@ polkit_unix_group_new (gint gid)
  * Creates a new #PolkitUnixGroup object for a group with the group name
  * @name.
  *
- * Returns: A #PolkitUnixGroup object or %NULL if @error is set.
+ * Returns: (allow-none): A #PolkitUnixGroup object or %NULL if @error
+ * is set.
  */
 PolkitIdentity *
 polkit_unix_group_new_for_name (const gchar    *name,
diff --git a/src/polkit/polkitunixprocess.c b/src/polkit/polkitunixprocess.c
index 8617c7f..b293ea0 100644
--- a/src/polkit/polkitunixprocess.c
+++ b/src/polkit/polkitunixprocess.c
@@ -204,7 +204,7 @@ polkit_unix_process_get_pid (PolkitUnixProcess *process)
 /**
  * polkit_unix_process_get_owner:
  * @process: A #PolkitUnixProcess.
- * @error: Return location for error or %NULL.
+ * @error: (allow-none): Return location for error or %NULL.
  *
  * Gets the uid of the owner of @process.
  *
diff --git a/src/polkit/polkitunixsession.c b/src/polkit/polkitunixsession.c
index 8f24e9f..a72e453 100644
--- a/src/polkit/polkitunixsession.c
+++ b/src/polkit/polkitunixsession.c
@@ -235,7 +235,7 @@ polkit_unix_session_new (const gchar *session_id)
 /**
  * polkit_unix_session_new_for_process:
  * @pid: The process id of the process to get the session for.
- * @cancellable: A #GCancellable or %NULL.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
  * @callback: A #GAsyncReadyCallback to call when the request is satisfied
  * @user_data: The data to pass to @callback.
  *
@@ -267,12 +267,13 @@ polkit_unix_session_new_for_process (gint                pid,
 /**
  * polkit_unix_session_new_for_process_finish:
  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to polkit_unix_session_new_for_process().
- * @error: Return location for error.
+ * @error: (allow-none): Return location for error.
  *
  * Finishes constructing a #PolkitSubject for a process id.
  *
- * Returns: A #PolkitUnixSession for the @pid passed to polkit_unix_session_new_for_process() or %NULL
- *     if @error is set. Free with g_object_unref().
+ * Returns: (allow-none): A #PolkitUnixSession for the @pid passed to
+ *     polkit_unix_session_new_for_process() or %NULL if @error is
+ *     set. Free with g_object_unref().
  **/
 PolkitSubject *
 polkit_unix_session_new_for_process_finish (GAsyncResult   *res,
@@ -299,15 +300,16 @@ polkit_unix_session_new_for_process_finish (GAsyncResult   *res,
 /**
  * polkit_unix_session_new_for_process_sync:
  * @pid: The process id of the process to get the session for.
- * @cancellable: A #GCancellable or %NULL.
- * @error: Return location for error.
+ * @cancellable: (allow-none): A #GCancellable or %NULL.
+ * @error: (allow-none): Return location for error.
  *
  * Creates a new #PolkitUnixSession for the process with process id @pid.
  *
  * This is a synchronous call that does blocking IO, for the asynchronous version, use
  * polkit_unix_session_new_for_process().
  *
- * Returns: A #PolkitUnixSession for @pid or %NULL if @error is set. Free with g_object_unref().
+ * Returns: (allow-none): A #PolkitUnixSession for @pid or %NULL if
+ * @error is set. Free with g_object_unref().
  **/
 PolkitSubject *
 polkit_unix_session_new_for_process_sync (gint           pid,
diff --git a/src/polkit/polkitunixuser.c b/src/polkit/polkitunixuser.c
index f592151..a57adaf 100644
--- a/src/polkit/polkitunixuser.c
+++ b/src/polkit/polkitunixuser.c
@@ -196,7 +196,7 @@ polkit_unix_user_new (gint uid)
  * Creates a new #PolkitUnixUser object for a user with the user name
  * @name.
  *
- * Returns: A #PolkitUnixUser object or %NULL if @error is set.
+ * Returns: (allow-none): A #PolkitUnixUser object or %NULL if @error is set.
  */
 PolkitIdentity *
 polkit_unix_user_new_for_name (const gchar    *name,


More information about the hal-commit mailing list