mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-11-04 10:08:56 +01:00 
			
		
		
		
	Some cleanups
Always include config.h, make property strings for translation, add since tags.
This commit is contained in:
		@@ -19,7 +19,10 @@
 | 
				
			|||||||
 * Author: Ryan Lortie <desrt@desrt.ca>
 | 
					 * Author: Ryan Lortie <desrt@desrt.ca>
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "config.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "gpermission.h"
 | 
					#include "gpermission.h"
 | 
				
			||||||
 | 
					#include "glibintl.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "gioalias.h"
 | 
					#include "gioalias.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -91,7 +94,9 @@ enum  {
 | 
				
			|||||||
 * This call is blocking, likely for a very long time (in the case that
 | 
					 * This call is blocking, likely for a very long time (in the case that
 | 
				
			||||||
 * user interaction is required).  See g_permission_acquire_async() for
 | 
					 * user interaction is required).  See g_permission_acquire_async() for
 | 
				
			||||||
 * the non-blocking version.
 | 
					 * the non-blocking version.
 | 
				
			||||||
 **/
 | 
					 *
 | 
				
			||||||
 | 
					 * Since: 2.26
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
gboolean
 | 
					gboolean
 | 
				
			||||||
g_permission_acquire (GPermission   *permission,
 | 
					g_permission_acquire (GPermission   *permission,
 | 
				
			||||||
                      GCancellable  *cancellable,
 | 
					                      GCancellable  *cancellable,
 | 
				
			||||||
@@ -112,6 +117,8 @@ g_permission_acquire (GPermission   *permission,
 | 
				
			|||||||
 *
 | 
					 *
 | 
				
			||||||
 * This is the first half of the asynchronous version of
 | 
					 * This is the first half of the asynchronous version of
 | 
				
			||||||
 * g_permission_acquire().
 | 
					 * g_permission_acquire().
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Since: 2.26
 | 
				
			||||||
 **/
 | 
					 **/
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
g_permission_acquire_async (GPermission         *permission,
 | 
					g_permission_acquire_async (GPermission         *permission,
 | 
				
			||||||
@@ -135,6 +142,8 @@ g_permission_acquire_async (GPermission         *permission,
 | 
				
			|||||||
 *
 | 
					 *
 | 
				
			||||||
 * This is the second half of the asynchronous version of
 | 
					 * This is the second half of the asynchronous version of
 | 
				
			||||||
 * g_permission_acquire().
 | 
					 * g_permission_acquire().
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Since: 2.26
 | 
				
			||||||
 **/
 | 
					 **/
 | 
				
			||||||
gboolean
 | 
					gboolean
 | 
				
			||||||
g_permission_acquire_finish (GPermission   *permission,
 | 
					g_permission_acquire_finish (GPermission   *permission,
 | 
				
			||||||
@@ -167,6 +176,8 @@ g_permission_acquire_finish (GPermission   *permission,
 | 
				
			|||||||
 * This call is blocking, likely for a very long time (in the case that
 | 
					 * This call is blocking, likely for a very long time (in the case that
 | 
				
			||||||
 * user interaction is required).  See g_permission_release_async() for
 | 
					 * user interaction is required).  See g_permission_release_async() for
 | 
				
			||||||
 * the non-blocking version.
 | 
					 * the non-blocking version.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Since: 2.26
 | 
				
			||||||
 **/
 | 
					 **/
 | 
				
			||||||
gboolean
 | 
					gboolean
 | 
				
			||||||
g_permission_release (GPermission   *permission,
 | 
					g_permission_release (GPermission   *permission,
 | 
				
			||||||
@@ -188,6 +199,8 @@ g_permission_release (GPermission   *permission,
 | 
				
			|||||||
 *
 | 
					 *
 | 
				
			||||||
 * This is the first half of the asynchronous version of
 | 
					 * This is the first half of the asynchronous version of
 | 
				
			||||||
 * g_permission_release().
 | 
					 * g_permission_release().
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Since: 2.26
 | 
				
			||||||
 **/
 | 
					 **/
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
g_permission_release_async (GPermission         *permission,
 | 
					g_permission_release_async (GPermission         *permission,
 | 
				
			||||||
@@ -211,6 +224,8 @@ g_permission_release_async (GPermission         *permission,
 | 
				
			|||||||
 *
 | 
					 *
 | 
				
			||||||
 * This is the second half of the asynchronous version of
 | 
					 * This is the second half of the asynchronous version of
 | 
				
			||||||
 * g_permission_release().
 | 
					 * g_permission_release().
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Since: 2.26
 | 
				
			||||||
 **/
 | 
					 **/
 | 
				
			||||||
gboolean
 | 
					gboolean
 | 
				
			||||||
g_permission_release_finish (GPermission   *permission,
 | 
					g_permission_release_finish (GPermission   *permission,
 | 
				
			||||||
@@ -229,6 +244,8 @@ g_permission_release_finish (GPermission   *permission,
 | 
				
			|||||||
 * Gets the value of the 'allowed' property.  This property is %TRUE if
 | 
					 * Gets the value of the 'allowed' property.  This property is %TRUE if
 | 
				
			||||||
 * the caller currently has permission to perform the action that
 | 
					 * the caller currently has permission to perform the action that
 | 
				
			||||||
 * @permission represents the permission to perform.
 | 
					 * @permission represents the permission to perform.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Since: 2.26
 | 
				
			||||||
 **/
 | 
					 **/
 | 
				
			||||||
gboolean
 | 
					gboolean
 | 
				
			||||||
g_permission_get_allowed (GPermission *permission)
 | 
					g_permission_get_allowed (GPermission *permission)
 | 
				
			||||||
@@ -244,6 +261,8 @@ g_permission_get_allowed (GPermission *permission)
 | 
				
			|||||||
 * Gets the value of the 'can-acquire' property.  This property is %TRUE
 | 
					 * Gets the value of the 'can-acquire' property.  This property is %TRUE
 | 
				
			||||||
 * if it is generally possible to acquire the permission by calling
 | 
					 * if it is generally possible to acquire the permission by calling
 | 
				
			||||||
 * g_permission_acquire().
 | 
					 * g_permission_acquire().
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Since: 2.26
 | 
				
			||||||
 **/
 | 
					 **/
 | 
				
			||||||
gboolean
 | 
					gboolean
 | 
				
			||||||
g_permission_get_can_acquire (GPermission *permission)
 | 
					g_permission_get_can_acquire (GPermission *permission)
 | 
				
			||||||
@@ -259,6 +278,8 @@ g_permission_get_can_acquire (GPermission *permission)
 | 
				
			|||||||
 * Gets the value of the 'can-release' property.  This property is %TRUE
 | 
					 * Gets the value of the 'can-release' property.  This property is %TRUE
 | 
				
			||||||
 * if it is generally possible to release the permission by calling
 | 
					 * if it is generally possible to release the permission by calling
 | 
				
			||||||
 * g_permission_release().
 | 
					 * g_permission_release().
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Since: 2.26
 | 
				
			||||||
 **/
 | 
					 **/
 | 
				
			||||||
gboolean
 | 
					gboolean
 | 
				
			||||||
g_permission_get_can_release (GPermission *permission)
 | 
					g_permission_get_can_release (GPermission *permission)
 | 
				
			||||||
@@ -278,6 +299,8 @@ g_permission_get_can_release (GPermission *permission)
 | 
				
			|||||||
 * function except from a #GPermission implementation.
 | 
					 * function except from a #GPermission implementation.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * GObject notify signals are generated, as appropriate.
 | 
					 * GObject notify signals are generated, as appropriate.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Since: 2.26
 | 
				
			||||||
 **/
 | 
					 **/
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
g_permission_impl_update (GPermission *permission,
 | 
					g_permission_impl_update (GPermission *permission,
 | 
				
			||||||
@@ -357,9 +380,11 @@ g_permission_class_init (GPermissionClass *class)
 | 
				
			|||||||
   * @permission represents the permission to perform.
 | 
					   * @permission represents the permission to perform.
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
   g_object_class_install_property (object_class, PROP_ALLOWED,
 | 
					   g_object_class_install_property (object_class, PROP_ALLOWED,
 | 
				
			||||||
     g_param_spec_boolean ("allowed", "is allowed",
 | 
					     g_param_spec_boolean ("allowed",
 | 
				
			||||||
                           "if the caller is allowed to perform the action",
 | 
					                           P(("Is allowed"),
 | 
				
			||||||
                           FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
 | 
					                           P_("If the caller is allowed to perform the action"),
 | 
				
			||||||
 | 
					                           FALSE,
 | 
				
			||||||
 | 
					                           G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /**
 | 
					  /**
 | 
				
			||||||
   * GPermission:can-acquire:
 | 
					   * GPermission:can-acquire:
 | 
				
			||||||
@@ -368,9 +393,11 @@ g_permission_class_init (GPermissionClass *class)
 | 
				
			|||||||
   * g_permission_acquire().
 | 
					   * g_permission_acquire().
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
   g_object_class_install_property (object_class, PROP_CAN_ACQUIRE,
 | 
					   g_object_class_install_property (object_class, PROP_CAN_ACQUIRE,
 | 
				
			||||||
     g_param_spec_boolean ("can-acquire", "can acquire",
 | 
					     g_param_spec_boolean ("can-acquire",
 | 
				
			||||||
                           "if calling g_permission_acquire() makes sense",
 | 
					                           P_("Can acquire"),
 | 
				
			||||||
                           FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
 | 
					                           P_("If calling g_permission_acquire() makes sense"),
 | 
				
			||||||
 | 
					                           FALSE,
 | 
				
			||||||
 | 
					                           G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /**
 | 
					  /**
 | 
				
			||||||
   * GPermission:can-release:
 | 
					   * GPermission:can-release:
 | 
				
			||||||
@@ -379,9 +406,11 @@ g_permission_class_init (GPermissionClass *class)
 | 
				
			|||||||
   * g_permission_release().
 | 
					   * g_permission_release().
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
   g_object_class_install_property (object_class, PROP_CAN_RELEASE,
 | 
					   g_object_class_install_property (object_class, PROP_CAN_RELEASE,
 | 
				
			||||||
     g_param_spec_boolean ("can-release", "can release",
 | 
					     g_param_spec_boolean ("can-release",
 | 
				
			||||||
                           "if calling g_permission_release() makes sense",
 | 
					                           P_("Can release"),
 | 
				
			||||||
                           FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
 | 
					                           P_("If calling g_permission_release() makes sense"),
 | 
				
			||||||
 | 
					                           FALSE,
 | 
				
			||||||
 | 
					                           G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  g_type_class_add_private (class, sizeof (GPermissionPrivate));
 | 
					  g_type_class_add_private (class, sizeof (GPermissionPrivate));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,6 +19,8 @@
 | 
				
			|||||||
 * Author: Ryan Lortie <desrt@desrt.ca>
 | 
					 * Author: Ryan Lortie <desrt@desrt.ca>
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "config.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "gsimplepermission.h"
 | 
					#include "gsimplepermission.h"
 | 
				
			||||||
#include "gpermission.h"
 | 
					#include "gpermission.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -27,7 +29,7 @@
 | 
				
			|||||||
/**
 | 
					/**
 | 
				
			||||||
 * SECTION:gsimplepermission
 | 
					 * SECTION:gsimplepermission
 | 
				
			||||||
 * @title: GSimplePermission
 | 
					 * @title: GSimplePermission
 | 
				
			||||||
 * @short_description: a #GPermission that doesn't change value
 | 
					 * @short_description: a GPermission that doesn't change value
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * #GSimplePermission is a trivial implementation of #GPermission that
 | 
					 * #GSimplePermission is a trivial implementation of #GPermission that
 | 
				
			||||||
 * represents a permission that is either always or never allowed.  The
 | 
					 * represents a permission that is either always or never allowed.  The
 | 
				
			||||||
@@ -69,6 +71,8 @@ g_simple_permission_class_init (GSimplePermissionClass *class)
 | 
				
			|||||||
 *
 | 
					 *
 | 
				
			||||||
 * Creates a new #GPermission instance that represents an action that is
 | 
					 * Creates a new #GPermission instance that represents an action that is
 | 
				
			||||||
 * either always or never allowed.
 | 
					 * either always or never allowed.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Since: 2.26
 | 
				
			||||||
 **/
 | 
					 **/
 | 
				
			||||||
GPermission *
 | 
					GPermission *
 | 
				
			||||||
g_simple_permission_new (gboolean allowed)
 | 
					g_simple_permission_new (gboolean allowed)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -84,6 +84,7 @@ gio/gnativevolumemonitor.c
 | 
				
			|||||||
gio/gnetworkaddress.c
 | 
					gio/gnetworkaddress.c
 | 
				
			||||||
gio/gnetworkservice.c
 | 
					gio/gnetworkservice.c
 | 
				
			||||||
gio/goutputstream.c
 | 
					gio/goutputstream.c
 | 
				
			||||||
 | 
					gio/gpermission.c
 | 
				
			||||||
gio/gpollfilemonitor.c
 | 
					gio/gpollfilemonitor.c
 | 
				
			||||||
gio/gresolver.c
 | 
					gio/gresolver.c
 | 
				
			||||||
gio/gschema-compile.c
 | 
					gio/gschema-compile.c
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user