X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gio%2Fgpermission.c;h=0fcd17ec74032b4627ffff9b77d4a103784aa56a;hb=c3842d1969feace4bfb12919be730e75e53877d9;hp=d781c3ae77af019f19a71eafe12626332073efe3;hpb=54cc43630ddf724722ebdfc1d6906dc1986b773d;p=platform%2Fupstream%2Fglib.git
diff --git a/gio/gpermission.c b/gio/gpermission.c
index d781c3a..0fcd17e 100644
--- a/gio/gpermission.c
+++ b/gio/gpermission.c
@@ -12,9 +12,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library; if not, see .
*
* Author: Ryan Lortie
*/
@@ -33,8 +31,9 @@
/**
* SECTION:gpermission
* @title: GPermission
- * @short_description: An object representing the permission to perform
- * a certain action
+ * @short_description: An object representing the permission
+ * to perform a certain action
+ * @include: gio/gio.h
*
* A #GPermission represents the status of the caller's permission to
* perform a certain action.
@@ -107,6 +106,7 @@ g_permission_acquire (GPermission *permission,
GCancellable *cancellable,
GError **error)
{
+ g_return_val_if_fail (G_IS_PERMISSION (permission), FALSE);
return G_PERMISSION_GET_CLASS (permission)
->acquire (permission, cancellable, error);
}
@@ -131,6 +131,7 @@ g_permission_acquire_async (GPermission *permission,
GAsyncReadyCallback callback,
gpointer user_data)
{
+ g_return_if_fail (G_IS_PERMISSION (permission));
G_PERMISSION_GET_CLASS (permission)
->acquire_async (permission, cancellable, callback, user_data);
}
@@ -156,6 +157,7 @@ g_permission_acquire_finish (GPermission *permission,
GAsyncResult *result,
GError **error)
{
+ g_return_val_if_fail (G_IS_PERMISSION (permission), FALSE);
return G_PERMISSION_GET_CLASS (permission)
->acquire_finish (permission, result, error);
}
@@ -191,6 +193,7 @@ g_permission_release (GPermission *permission,
GCancellable *cancellable,
GError **error)
{
+ g_return_val_if_fail (G_IS_PERMISSION (permission), FALSE);
return G_PERMISSION_GET_CLASS (permission)
->release (permission, cancellable, error);
}
@@ -215,6 +218,7 @@ g_permission_release_async (GPermission *permission,
GAsyncReadyCallback callback,
gpointer user_data)
{
+ g_return_if_fail (G_IS_PERMISSION (permission));
G_PERMISSION_GET_CLASS (permission)
->release_async (permission, cancellable, callback, user_data);
}
@@ -240,6 +244,7 @@ g_permission_release_finish (GPermission *permission,
GAsyncResult *result,
GError **error)
{
+ g_return_val_if_fail (G_IS_PERMISSION (permission), FALSE);
return G_PERMISSION_GET_CLASS (permission)
->release_finish (permission, result, error);
}
@@ -259,6 +264,7 @@ g_permission_release_finish (GPermission *permission,
gboolean
g_permission_get_allowed (GPermission *permission)
{
+ g_return_val_if_fail (G_IS_PERMISSION (permission), FALSE);
return permission->priv->allowed;
}
@@ -277,6 +283,7 @@ g_permission_get_allowed (GPermission *permission)
gboolean
g_permission_get_can_acquire (GPermission *permission)
{
+ g_return_val_if_fail (G_IS_PERMISSION (permission), FALSE);
return permission->priv->can_acquire;
}
@@ -295,6 +302,7 @@ g_permission_get_can_acquire (GPermission *permission)
gboolean
g_permission_get_can_release (GPermission *permission)
{
+ g_return_val_if_fail (G_IS_PERMISSION (permission), FALSE);
return permission->priv->can_release;
}
@@ -319,8 +327,11 @@ g_permission_impl_update (GPermission *permission,
gboolean can_acquire,
gboolean can_release)
{
- GObject *object = G_OBJECT (permission);
+ GObject *object;
+ g_return_if_fail (G_IS_PERMISSION (permission));
+
+ object = G_OBJECT (permission);
g_object_freeze_notify (object);
allowed = allowed != FALSE;