[frogr] Added new 'is-video' construct-only property to FrogrPicture
- From: Mario Sanchez Prada <msanchez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [frogr] Added new 'is-video' construct-only property to FrogrPicture
- Date: Sun, 4 Nov 2012 21:46:47 +0000 (UTC)
commit 20210610b6dd5284ca695cd77c592d7d61ac3788
Author: Mario Sanchez Prada <msanchez gnome org>
Date: Sat Nov 3 11:17:06 2012 +0100
Added new 'is-video' construct-only property to FrogrPicture
src/frogr-file-loader.c | 3 ++-
src/frogr-picture.c | 32 +++++++++++++++++++++++++++++++-
src/frogr-picture.h | 5 ++++-
3 files changed, 37 insertions(+), 3 deletions(-)
---
diff --git a/src/frogr-file-loader.c b/src/frogr-file-loader.c
index fd30ff8..76c774a 100644
--- a/src/frogr-file-loader.c
+++ b/src/frogr-file-loader.c
@@ -276,7 +276,8 @@ _load_next_file_cb (GObject *object,
file_name,
priv->public_visibility,
priv->family_visibility,
- priv->friend_visibility);
+ priv->friend_visibility,
+ FALSE);
frogr_picture_set_send_location (fpicture, priv->send_location);
frogr_picture_set_show_in_search (fpicture, priv->show_in_search);
diff --git a/src/frogr-picture.c b/src/frogr-picture.c
index 6789943..ec32f48 100644
--- a/src/frogr-picture.c
+++ b/src/frogr-picture.c
@@ -51,6 +51,8 @@ struct _FrogrPicturePrivate
gboolean show_in_search;
gboolean send_location;
+ gboolean is_video;
+
gulong filesize; /* In KB */
gchar *datetime; /* ASCII, locale dependent, string */
@@ -77,6 +79,7 @@ enum {
PROP_LOCATION,
PROP_SHOW_IN_SEARCH,
PROP_SEND_LOCATION,
+ PROP_IS_VIDEO,
PROP_FILESIZE,
PROP_DATETIME,
PROP_PHOTOSETS,
@@ -237,6 +240,9 @@ _frogr_picture_set_property (GObject *object,
case PROP_SEND_LOCATION:
frogr_picture_set_send_location (self, g_value_get_boolean (value));
break;
+ case PROP_IS_VIDEO:
+ priv->is_video = g_value_get_boolean (value);
+ break;
case PROP_FILESIZE:
frogr_picture_set_filesize (self, g_value_get_long (value));
break;
@@ -310,6 +316,9 @@ _frogr_picture_get_property (GObject *object,
case PROP_SEND_LOCATION:
g_value_set_boolean (value, priv->send_location);
break;
+ case PROP_IS_VIDEO:
+ g_value_set_boolean (value, priv->is_video);
+ break;
case PROP_FILESIZE:
g_value_set_long (value, priv->filesize);
break;
@@ -527,6 +536,13 @@ frogr_picture_class_init(FrogrPictureClass *klass)
0,
G_PARAM_READWRITE));
g_object_class_install_property (obj_class,
+ PROP_IS_VIDEO,
+ g_param_spec_boolean ("is-video",
+ "is-video",
+ "Whether FrogrPicture represents a video",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ g_object_class_install_property (obj_class,
PROP_DATETIME,
g_param_spec_string ("datetime",
"datetime",
@@ -582,6 +598,8 @@ frogr_picture_init (FrogrPicture *self)
priv->show_in_search = TRUE;
priv->send_location = FALSE;
+ priv->is_video = FALSE;
+
priv->filesize = 0;
priv->datetime = NULL;
@@ -599,7 +617,8 @@ frogr_picture_new (const gchar *fileuri,
const gchar *title,
gboolean public,
gboolean family,
- gboolean friend)
+ gboolean friend,
+ gboolean is_video)
{
g_return_val_if_fail (fileuri, NULL);
g_return_val_if_fail (title, NULL);
@@ -610,6 +629,7 @@ frogr_picture_new (const gchar *fileuri,
"is-public", public,
"is-family", family,
"is-friend", friend,
+ "is-video", is_video,
NULL));
}
@@ -989,6 +1009,16 @@ frogr_picture_set_pixbuf (FrogrPicture *self,
priv->pixbuf = GDK_IS_PIXBUF (pixbuf) ? g_object_ref (pixbuf) : NULL;
}
+gboolean frogr_picture_is_video (FrogrPicture *self)
+{
+ FrogrPicturePrivate *priv = NULL;
+
+ g_return_val_if_fail(FROGR_IS_PICTURE(self), FALSE);
+
+ priv = FROGR_PICTURE_GET_PRIVATE (self);
+ return priv->is_video;
+}
+
gulong frogr_picture_get_filesize (FrogrPicture *self)
{
FrogrPicturePrivate *priv = NULL;
diff --git a/src/frogr-picture.h b/src/frogr-picture.h
index 33c0927..94fbe8f 100644
--- a/src/frogr-picture.h
+++ b/src/frogr-picture.h
@@ -60,7 +60,8 @@ FrogrPicture *frogr_picture_new (const gchar *fileuri,
const gchar *title,
gboolean public,
gboolean family,
- gboolean friend);
+ gboolean friend,
+ gboolean is_video);
/* Data managing methods */
@@ -119,6 +120,8 @@ GdkPixbuf *frogr_picture_get_pixbuf (FrogrPicture *self);
void frogr_picture_set_pixbuf (FrogrPicture *self,
GdkPixbuf *pixbuf);
+gboolean frogr_picture_is_video (FrogrPicture *self);
+
gulong frogr_picture_get_filesize (FrogrPicture *self);
void frogr_picture_set_filesize (FrogrPicture *self, gulong filesize);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]