PolicyKit: Branch 'master' - 2 commits

David Zeuthen david at kemper.freedesktop.org
Thu Feb 17 12:28:42 PST 2011


 src/polkit/Makefile.am                |   21 +--------------
 src/polkit/polkitactiondescription.c  |    2 -
 src/polkit/polkitauthority.c          |   45 +++++++++++++++++++++++-----------
 src/polkit/polkitauthority.h          |    8 ------
 src/polkit/polkitdetails.c            |    5 ++-
 src/polkit/polkitidentity.c           |    4 +--
 src/polkit/polkitsubject.c            |    4 +--
 src/polkit/polkitsystembusname.c      |    4 +--
 src/polkit/polkitunixgroup.c          |    4 +--
 src/polkit/polkitunixprocess.c        |    4 +--
 src/polkit/polkitunixsession.c        |    8 +++---
 src/polkit/polkitunixuser.c           |    4 +--
 src/polkitagent/Makefile.am           |   33 ++++++++++++++++++++++++
 src/polkitagent/polkitagentlistener.c |    5 ++-
 14 files changed, 89 insertions(+), 62 deletions(-)

New commits:
commit be7dc89dbe59175336ef53f023d9fac7c0f2aa68
Author: David Zeuthen <davidz at redhat.com>
Date:   Thu Feb 17 15:25:39 2011 -0500

    Build gir/typelib for PolkitAgent-1.0
    
    Signed-off-by: David Zeuthen <davidz at redhat.com>

diff --git a/src/polkitagent/Makefile.am b/src/polkitagent/Makefile.am
index 96ffd7c..d93d871 100644
--- a/src/polkitagent/Makefile.am
+++ b/src/polkitagent/Makefile.am
@@ -100,6 +100,39 @@ polkit_agent_helper_1_LDADD = 						\
 	$(top_builddir)/src/polkit/libpolkit-gobject-1.la		\
 	$(NULL)
 
+if ENABLE_INTROSPECTION
+girdir = $(GIRDIR)
+gir_DATA = PolkitAgent-1.0.gir
+
+typelibsdir = $(GIRTYPELIBDIR)
+typelibs_DATA = PolkitAgent-1.0.typelib
+
+PolkitAgent-1.0.gir: libpolkit-agent-1.la $(G_IR_SCANNER) Makefile.am
+	$(G_IR_SCANNER) -v 					\
+		--warn-all					\
+		--namespace PolkitAgent				\
+		--nsversion=1.0 				\
+		--include=Gio-2.0 				\
+		--include-uninstalled=$(top_builddir)/src/polkit/Polkit-1.0.gir	\
+		--library=polkit-agent-1 			\
+		--output $@ 					\
+		--pkg=glib-2.0 					\
+		--pkg=gobject-2.0 				\
+		--pkg=gio-2.0 					\
+		--libtool=$(top_builddir)/libtool		\
+                -I$(top_srcdir)/src	 			\
+	        -D_POLKIT_COMPILATION                   	\
+	        -D_POLKIT_AGENT_COMPILATION                   	\
+		$(libpolkit_agent_1_la_SOURCES)			\
+		$(NULL)
+
+PolkitAgent-1.0.typelib: PolkitAgent-1.0.gir $(G_IR_COMPILER)
+	$(G_IR_COMPILER) 					\
+		--includedir $(top_builddir)/src/polkit		\
+		$< -o $@
+
+endif # ENABLE_INTROSPECTION
+
 # polkit-agent-helper-1 need to be setuid root because it's used to
 # authenticate not only the invoking user, but possibly also root
 # and/or other users.
diff --git a/src/polkitagent/polkitagentlistener.c b/src/polkitagent/polkitagentlistener.c
index 5e71ec1..dbbfd63 100644
--- a/src/polkitagent/polkitagentlistener.c
+++ b/src/polkitagent/polkitagentlistener.c
@@ -385,8 +385,9 @@ server_thread_func (gpointer user_data)
  *
  * Note that the calling thread is blocked until a reply is received.
  *
- * Returns: %NULL if @error is set, otherwise a registration handle
- * that can be used with polkit_agent_listener_unregister().
+ * Returns: (transfer full): %NULL if @error is set, otherwise a
+ * registration handle that can be used with
+ * polkit_agent_listener_unregister().
  */
 gpointer
 polkit_agent_listener_register (PolkitAgentListener      *listener,
commit cb7bfcb8188169ac1cc9085359500637120dfa0c
Author: David Zeuthen <davidz at redhat.com>
Date:   Thu Feb 17 15:10:49 2011 -0500

    Add missing GObject Introspection annotations
    
    Signed-off-by: David Zeuthen <davidz at redhat.com>

diff --git a/src/polkit/Makefile.am b/src/polkit/Makefile.am
index 4afd4ee..e44df1f 100644
--- a/src/polkit/Makefile.am
+++ b/src/polkit/Makefile.am
@@ -100,6 +100,7 @@ typelibs_DATA = Polkit-1.0.typelib
 
 Polkit-1.0.gir: libpolkit-gobject-1.la $(G_IR_SCANNER) Makefile.am
 	$(G_IR_SCANNER) -v 					\
+		--warn-all					\
 		--namespace Polkit 				\
 		--nsversion=1.0 				\
 		--include=Gio-2.0 				\
@@ -111,25 +112,7 @@ Polkit-1.0.gir: libpolkit-gobject-1.la $(G_IR_SCANNER) Makefile.am
 		--libtool=$(top_builddir)/libtool		\
                 -I$(top_srcdir)/src	 			\
 	        -D_POLKIT_COMPILATION                   	\
-		$(srcdir)/polkit.h 				\
-		$(srcdir)/polkittypes.h 			\
-		$(srcdir)/polkitactiondescription.h 		\
-		$(srcdir)/polkitauthority.h 			\
-		$(srcdir)/polkitauthorizationresult.h 		\
-		$(srcdir)/polkitcheckauthorizationflags.h 	\
-		$(srcdir)/polkitdetails.h 			\
-		$(builddir)/polkitenumtypes.h 			\
-		$(srcdir)/polkiterror.h 			\
-		$(srcdir)/polkitidentity.h 			\
-		$(srcdir)/polkitimplicitauthorization.h 	\
-		$(srcdir)/polkitsubject.h 			\
-		$(srcdir)/polkitsystembusname.h 		\
-		$(srcdir)/polkittemporaryauthorization.h 	\
-		$(srcdir)/polkitunixgroup.h 			\
-		$(srcdir)/polkitunixprocess.h 			\
-		$(srcdir)/polkitunixsession.h 			\
-		$(srcdir)/polkitunixuser.h 			\
-		$(srcdir)/polkitpermission.h 			\
+		$(libpolkit_gobject_1_la_SOURCES)		\
 		$(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 6930cc4..0391efd 100644
--- a/src/polkit/polkitactiondescription.c
+++ b/src/polkit/polkitactiondescription.c
@@ -265,7 +265,7 @@ polkit_action_description_get_annotation (PolkitActionDescription *action_descri
  *
  * Gets the keys of annotations defined in @action_description.
  *
- * Returns: The annotation keys owned by @action_description. Do not free.
+ * Returns: (transfer none): The annotation keys owned by @action_description. Do not free.
  */
 const gchar * const *
 polkit_action_description_get_annotation_keys (PolkitActionDescription *action_description)
diff --git a/src/polkit/polkitauthority.c b/src/polkit/polkitauthority.c
index 404be18..cc24e6c 100644
--- a/src/polkit/polkitauthority.c
+++ b/src/polkit/polkitauthority.c
@@ -370,6 +370,14 @@ async_initable_iface_init (GAsyncInitableIface *async_initable_iface)
 /* ---------------------------------------------------------------------------------------------------- */
 
 /* deprecated, see polkitauthority.h */
+
+/**
+ * polkit_authority_get:
+ *
+ * (deprecated)
+ *
+ * Returns: (transfer full): value
+ */
 PolkitAuthority *
 polkit_authority_get (void)
 {
@@ -498,8 +506,8 @@ polkit_authority_get_async  (GCancellable        *cancellable,
  *
  * Finishes an operation started with polkit_authority_get_async().
  *
- * Returns: A #PolkitAuthority. Free it with g_object_unref() when
- * done with it.
+ * Returns: (transfer full): A #PolkitAuthority. Free it with
+ * g_object_unref() when done with it.
  */
 PolkitAuthority *
 polkit_authority_get_finish (GAsyncResult        *res,
@@ -540,8 +548,8 @@ polkit_authority_get_finish (GAsyncResult        *res,
  * blocked until a reply is received. See polkit_authority_get_async()
  * for the asynchronous version.
  *
- * Returns: A #PolkitAuthority. Free it with g_object_unref() when
- * done with it.
+ * Returns: (transfer full): A #PolkitAuthority. Free it with
+ * g_object_unref() when done with it.
  */
 PolkitAuthority *
 polkit_authority_get_sync (GCancellable        *cancellable,
@@ -672,8 +680,10 @@ polkit_authority_enumerate_actions (PolkitAuthority     *authority,
  *
  * Finishes retrieving all registered actions.
  *
- * Returns: A list of #PolkitActionDescription objects or %NULL if @error is set. The returned list
- * should be freed with g_list_free() after each element have been freed with g_object_unref().
+ * Returns: (transfer full): A list of #PolkitActionDescription
+ * objects or %NULL if @error is set. The returned list should be
+ * freed with g_list_free() after each element have been freed with
+ * g_object_unref().
  **/
 GList *
 polkit_authority_enumerate_actions_finish (PolkitAuthority *authority,
@@ -726,8 +736,10 @@ polkit_authority_enumerate_actions_finish (PolkitAuthority *authority,
  * is blocked until a reply is received. See
  * polkit_authority_enumerate_actions() for the asynchronous version.
  *
- * Returns: A list of #PolkitActionDescription or %NULL if @error is set. The returned list
- * should be freed with g_list_free() after each element have been freed with g_object_unref().
+ * Returns: (transfer full): A list of #PolkitActionDescription or
+ * %NULL if @error is set. The returned list should be freed with
+ * g_list_free() after each element have been freed with
+ * g_object_unref().
  **/
 GList *
 polkit_authority_enumerate_actions_sync (PolkitAuthority *authority,
@@ -919,7 +931,8 @@ polkit_authority_check_authorization (PolkitAuthority               *authority,
  *
  * Finishes checking if a subject is authorized for an action.
  *
- * Returns: A #PolkitAuthorizationResult or %NULL if @error is set. Free with g_object_unref().
+ * Returns: (transfer full): A #PolkitAuthorizationResult or %NULL if
+ * @error is set. Free with g_object_unref().
  **/
 PolkitAuthorizationResult *
 polkit_authority_check_authorization_finish (PolkitAuthority          *authority,
@@ -972,7 +985,7 @@ polkit_authority_check_authorization_finish (PolkitAuthority          *authority
  * operation to complete because it involves waiting for the user to
  * authenticate.
  *
- * Returns: A #PolkitAuthorizationResult or %NULL if @error is set. Free with g_object_unref().
+ * Returns: (transfer full): A #PolkitAuthorizationResult or %NULL if @error is set. Free with g_object_unref().
  */
 PolkitAuthorizationResult *
 polkit_authority_check_authorization_sync (PolkitAuthority               *authority,
@@ -1469,8 +1482,10 @@ polkit_authority_enumerate_temporary_authorizations (PolkitAuthority     *author
  *
  * Finishes retrieving all registered actions.
  *
- * Returns: A list of #PolkitTemporaryAuthorization objects or %NULL if @error is set. The returned list
- * should be freed with g_list_free() after each element have been freed with g_object_unref().
+ * Returns: (transfer full): A list of #PolkitTemporaryAuthorization
+ * objects or %NULL if @error is set. The returned list should be
+ * freed with g_list_free() after each element have been freed with
+ * g_object_unref().
  **/
 GList *
 polkit_authority_enumerate_temporary_authorizations_finish (PolkitAuthority *authority,
@@ -1534,8 +1549,10 @@ polkit_authority_enumerate_temporary_authorizations_finish (PolkitAuthority *aut
  * polkit_authority_enumerate_temporary_authorizations() for the
  * asynchronous version.
  *
- * Returns: A list of #PolkitTemporaryAuthorization objects or %NULL if @error is set. The returned list
- * should be freed with g_list_free() after each element have been freed with g_object_unref().
+ * Returns: (transfer full): A list of #PolkitTemporaryAuthorization
+ * objects or %NULL if @error is set. The returned list should be
+ * freed with g_list_free() after each element have been freed with
+ * g_object_unref().
  **/
 GList *
 polkit_authority_enumerate_temporary_authorizations_sync (PolkitAuthority     *authority,
diff --git a/src/polkit/polkitauthority.h b/src/polkit/polkitauthority.h
index f363228..edd8a62 100644
--- a/src/polkit/polkitauthority.h
+++ b/src/polkit/polkitauthority.h
@@ -68,14 +68,6 @@ GList                     *polkit_authority_enumerate_actions_sync (PolkitAuthor
                                                                     GCancellable    *cancellable,
                                                                     GError         **error);
 
-GList                     *polkit_authority_enumerate_users_sync (PolkitAuthority *authority,
-                                                                  GCancellable    *cancellable,
-                                                                  GError         **error);
-
-GList                     *polkit_authority_enumerate_groups_sync (PolkitAuthority *authority,
-                                                                   GCancellable    *cancellable,
-                                                                   GError         **error);
-
 PolkitAuthorizationResult *polkit_authority_check_authorization_sync (PolkitAuthority               *authority,
                                                                       PolkitSubject                 *subject,
                                                                       const gchar                   *action_id,
diff --git a/src/polkit/polkitdetails.c b/src/polkit/polkitdetails.c
index 4f6555d..9c5c7e7 100644
--- a/src/polkit/polkitdetails.c
+++ b/src/polkit/polkitdetails.c
@@ -164,8 +164,9 @@ polkit_details_insert (PolkitDetails *details,
  *
  * Gets a list of all keys on @details.
  *
- * Returns: (allow-none): %NULL if there are no keys otherwise an
- * array of strings that should be freed with g_strfreev().
+ * Returns: (transfer full) (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/polkitidentity.c b/src/polkit/polkitidentity.c
index 413b41f..21c326b 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: (allow-none): A #PolkitIdentity or %NULL if @error is
- * set. Free with g_object_unref().
+ * Returns: (allow-none) (transfer full): 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/polkitsubject.c b/src/polkit/polkitsubject.c
index d193eb2..577afec 100644
--- a/src/polkit/polkitsubject.c
+++ b/src/polkit/polkitsubject.c
@@ -218,8 +218,8 @@ polkit_subject_exists_sync   (PolkitSubject  *subject,
  * Creates an object from @str that implements the #PolkitSubject
  * interface.
  *
- * Returns: A #PolkitSubject or %NULL if @error is set. Free with
- * g_object_unref().
+ * Returns: (transfer full): A #PolkitSubject or %NULL if @error is
+ * set. Free with g_object_unref().
  */
 PolkitSubject *
 polkit_subject_from_string  (const gchar   *str,
diff --git a/src/polkit/polkitsystembusname.c b/src/polkit/polkitsystembusname.c
index 41f2762..2a297c4 100644
--- a/src/polkit/polkitsystembusname.c
+++ b/src/polkit/polkitsystembusname.c
@@ -190,7 +190,7 @@ polkit_system_bus_name_set_name (PolkitSystemBusName *system_bus_name,
  *
  * Creates a new #PolkitSystemBusName for @name.
  *
- * Returns: A #PolkitSystemBusName. Free with g_object_unref().
+ * Returns: (transfer full): A #PolkitSystemBusName. Free with g_object_unref().
  */
 PolkitSubject *
 polkit_system_bus_name_new (const gchar *name)
@@ -349,7 +349,7 @@ subject_iface_init (PolkitSubjectIface *subject_iface)
  * Synchronously gets a #PolkitUnixProcess object for @system_bus_name
  * - the calling thread is blocked until a reply is received.
  *
- * Returns: (allow-none): A #PolkitUnixProcess object or %NULL if @error is set.
+ * Returns: (allow-none) (transfer full): 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/polkitunixgroup.c b/src/polkit/polkitunixgroup.c
index c9838e5..c57a1aa 100644
--- a/src/polkit/polkitunixgroup.c
+++ b/src/polkit/polkitunixgroup.c
@@ -178,7 +178,7 @@ polkit_unix_group_set_gid (PolkitUnixGroup *group,
  *
  * Creates a new #PolkitUnixGroup object for @gid.
  *
- * Returns: A #PolkitUnixGroup object. Free with g_object_unref().
+ * Returns: (transfer full): A #PolkitUnixGroup object. Free with g_object_unref().
  */
 PolkitIdentity *
 polkit_unix_group_new (gint gid)
@@ -196,7 +196,7 @@ polkit_unix_group_new (gint gid)
  * Creates a new #PolkitUnixGroup object for a group with the group name
  * @name.
  *
- * Returns: (allow-none): A #PolkitUnixGroup object or %NULL if @error
+ * Returns: (transfer full): (allow-none): A #PolkitUnixGroup object or %NULL if @error
  * is set.
  */
 PolkitIdentity *
diff --git a/src/polkit/polkitunixprocess.c b/src/polkit/polkitunixprocess.c
index b293ea0..d95a1d4 100644
--- a/src/polkit/polkitunixprocess.c
+++ b/src/polkit/polkitunixprocess.c
@@ -302,7 +302,7 @@ polkit_unix_process_set_pid (PolkitUnixProcess *process,
  * <filename>/proc</filename> filesystem depending on the platform in
  * use.
  *
- * Returns: A #PolkitSubject. Free with g_object_unref().
+ * Returns: (transfer full): A #PolkitSubject. Free with g_object_unref().
  */
 PolkitSubject *
 polkit_unix_process_new (gint pid)
@@ -319,7 +319,7 @@ polkit_unix_process_new (gint pid)
  *
  * Creates a new #PolkitUnixProcess object for @pid and @start_time.
  *
- * Returns: A #PolkitSubject. Free with g_object_unref().
+ * Returns: (transfer full): A #PolkitSubject. Free with g_object_unref().
  */
 PolkitSubject *
 polkit_unix_process_new_full (gint pid,
diff --git a/src/polkit/polkitunixsession.c b/src/polkit/polkitunixsession.c
index c466561..40817de 100644
--- a/src/polkit/polkitunixsession.c
+++ b/src/polkit/polkitunixsession.c
@@ -222,7 +222,7 @@ polkit_unix_session_set_session_id (PolkitUnixSession *session,
  *
  * Creates a new #PolkitUnixSession for @session_id.
  *
- * Returns: A #PolkitUnixSession. Free with g_object_unref().
+ * Returns: (transfer full): A #PolkitUnixSession. Free with g_object_unref().
  **/
 PolkitSubject *
 polkit_unix_session_new (const gchar *session_id)
@@ -274,7 +274,7 @@ polkit_unix_session_new_for_process (gint                pid,
  *
  * Finishes constructing a #PolkitSubject for a process id.
  *
- * Returns: (allow-none): A #PolkitUnixSession for the @pid passed to
+ * Returns: (transfer full) (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().
  **/
@@ -312,8 +312,8 @@ polkit_unix_session_new_for_process_finish (GAsyncResult   *res,
  * reply is received. For the asynchronous version, see
  * polkit_unix_session_new_for_process().
  *
- * Returns: (allow-none): A #PolkitUnixSession for @pid or %NULL if
- * @error is set. Free with g_object_unref().
+ * Returns: (allow-none) (transfer full): 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 a57adaf..1c9cf49 100644
--- a/src/polkit/polkitunixuser.c
+++ b/src/polkit/polkitunixuser.c
@@ -178,7 +178,7 @@ polkit_unix_user_set_uid (PolkitUnixUser *user,
  *
  * Creates a new #PolkitUnixUser object for @uid.
  *
- * Returns: A #PolkitUnixUser object. Free with g_object_unref().
+ * Returns: (transfer full): A #PolkitUnixUser object. Free with g_object_unref().
  */
 PolkitIdentity *
 polkit_unix_user_new (gint uid)
@@ -196,7 +196,7 @@ polkit_unix_user_new (gint uid)
  * Creates a new #PolkitUnixUser object for a user with the user name
  * @name.
  *
- * Returns: (allow-none): A #PolkitUnixUser object or %NULL if @error is set.
+ * Returns: (allow-none) (transfer full): 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