[frogr] New function frogr_picture_add_group()
- From: Mario Sanchez Prada <msanchez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [frogr] New function frogr_picture_add_group()
- Date: Sun, 11 Nov 2012 00:10:34 +0000 (UTC)
commit ea742a342b862f6613f558ce58ce51dd70302c4e
Author: Mario Sanchez Prada <msanchez gnome org>
Date: Sat Nov 10 03:17:20 2012 +0100
New function frogr_picture_add_group()
src/frogr-picture.c | 16 ++++++++++++++++
src/frogr-picture.h | 1 +
2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/frogr-picture.c b/src/frogr-picture.c
index fb3c0c4..abe9e5a 100644
--- a/src/frogr-picture.c
+++ b/src/frogr-picture.c
@@ -1337,6 +1337,22 @@ frogr_picture_set_groups (FrogrPicture *self, GSList *groups)
}
void
+frogr_picture_add_group (FrogrPicture *self, FrogrGroup *group)
+{
+ FrogrPicturePrivate *priv = NULL;
+
+ g_return_if_fail(FROGR_IS_PICTURE(self));
+ g_return_if_fail(FROGR_IS_GROUP(group));
+
+ /* Do not add the same set twice */
+ if (frogr_picture_in_group (self, group))
+ return;
+
+ priv = FROGR_PICTURE_GET_PRIVATE (self);
+ priv->groups = g_slist_append (priv->groups, g_object_ref (group));
+}
+
+void
frogr_picture_remove_groups (FrogrPicture *self)
{
g_return_if_fail(FROGR_IS_PICTURE(self));
diff --git a/src/frogr-picture.h b/src/frogr-picture.h
index b6dc881..3c85f2c 100644
--- a/src/frogr-picture.h
+++ b/src/frogr-picture.h
@@ -136,6 +136,7 @@ gboolean frogr_picture_in_photoset (FrogrPicture *self, FrogrPhotoSet *set);
GSList *frogr_picture_get_groups (FrogrPicture *self);
void frogr_picture_set_groups (FrogrPicture *self, GSList *groups);
+void frogr_picture_add_group (FrogrPicture *self, FrogrGroup *group);
void frogr_picture_remove_groups (FrogrPicture *self);
gboolean frogr_picture_in_group (FrogrPicture *self, FrogrGroup *group);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]