Commit 84a9cd17 authored by David Zeuthen's avatar David Zeuthen

Update GI annotations

Signed-off-by: default avatarDavid Zeuthen <davidz@redhat.com>
parent 7d5eff96
......@@ -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)
......
......@@ -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,
......
This diff is collapsed.
......@@ -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)
......
......@@ -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)
......
......@@ -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);
......
......@@ -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,
......
......@@ -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)
......
......@@ -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.
......
......@@ -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,
......
......@@ -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)
......
......@@ -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,
......
......@@ -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.
*
......
......@@ -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,
......
......@@ -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,
......
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