[frogr] New bool property in FrogrPicture for sending location info.
- From: Mario Sanchez Prada <msanchez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [frogr] New bool property in FrogrPicture for sending location info.
- Date: Sun, 14 Aug 2011 23:56:50 +0000 (UTC)
commit c1c5c363b7d434bef81278de49b7d8d741a0027b
Author: Mario Sanchez Prada <msanchez igalia com>
Date: Mon Aug 15 00:55:55 2011 +0200
New bool property in FrogrPicture for sending location info.
src/frogr-picture.c | 44 ++++++++++++++++++++++++++++++++++++++++++--
src/frogr-picture.h | 4 ++++
2 files changed, 46 insertions(+), 2 deletions(-)
---
diff --git a/src/frogr-picture.c b/src/frogr-picture.c
index bc39ba3..3b69cc5 100644
--- a/src/frogr-picture.c
+++ b/src/frogr-picture.c
@@ -55,6 +55,7 @@ struct _FrogrPicturePrivate
FspLicense license;
FspDataLocation *location;
gboolean show_in_search;
+ gboolean send_location;
GdkPixbuf *pixbuf;
};
@@ -74,6 +75,7 @@ enum {
PROP_CONTENT_TYPE,
PROP_LICENSE,
PROP_SHOW_IN_SEARCH,
+ PROP_SEND_LOCATION,
PROP_PIXBUF,
PROP_FILESIZE,
PROP_DATETIME
@@ -225,6 +227,9 @@ _frogr_picture_set_property (GObject *object,
case PROP_SHOW_IN_SEARCH:
frogr_picture_set_show_in_search (self, g_value_get_boolean (value));
break;
+ case PROP_SEND_LOCATION:
+ frogr_picture_set_send_location (self, g_value_get_boolean (value));
+ break;
case PROP_PIXBUF:
frogr_picture_set_pixbuf (self, GDK_PIXBUF (g_value_get_object (value)));
break;
@@ -286,6 +291,9 @@ _frogr_picture_get_property (GObject *object,
case PROP_SHOW_IN_SEARCH:
g_value_set_boolean (value, priv->show_in_search);
break;
+ case PROP_SEND_LOCATION:
+ g_value_set_boolean (value, priv->send_location);
+ break;
case PROP_PIXBUF:
g_value_set_object (value, priv->pixbuf);
break;
@@ -464,12 +472,20 @@ frogr_picture_class_init(FrogrPictureClass *klass)
PROP_SHOW_IN_SEARCH,
g_param_spec_boolean ("show-in-search",
"show-in-search",
- "Whether the show the "
+ "Whether to show the "
"picture in global "
"search results",
FALSE,
G_PARAM_READWRITE));
g_object_class_install_property (obj_class,
+ PROP_SEND_LOCATION,
+ g_param_spec_boolean ("send-location",
+ "send-location",
+ "Whether to send the location "
+ "to flickr, if available",
+ FALSE,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (obj_class,
PROP_PIXBUF,
g_param_spec_object ("pixbuf",
"pixbuf",
@@ -525,6 +541,7 @@ frogr_picture_init (FrogrPicture *self)
priv->license = FSP_LICENSE_NONE;
priv->show_in_search = TRUE;
+ priv->send_location = FALSE;
priv->pixbuf = NULL;
}
@@ -551,7 +568,8 @@ frogr_picture_new (const gchar *fileuri,
"safety-level", FSP_SAFETY_LEVEL_SAFE,
"content-type", FSP_CONTENT_TYPE_PHOTO,
"license", FSP_LICENSE_NONE,
- "show_in_search", TRUE,
+ "show-in-search", TRUE,
+ "send-location", FALSE,
NULL));
}
@@ -848,6 +866,28 @@ frogr_picture_set_license (FrogrPicture *self, FspLicense license)
priv->license = license;
}
+gboolean
+frogr_picture_send_location (FrogrPicture *self)
+{
+ FrogrPicturePrivate *priv = NULL;
+
+ g_return_val_if_fail(FROGR_IS_PICTURE(self), FALSE);
+
+ priv = FROGR_PICTURE_GET_PRIVATE (self);
+ return priv->send_location;
+}
+
+void
+frogr_picture_set_send_location (FrogrPicture *self, gboolean send_location)
+{
+ FrogrPicturePrivate *priv = NULL;
+
+ g_return_if_fail(FROGR_IS_PICTURE(self));
+
+ priv = FROGR_PICTURE_GET_PRIVATE (self);
+ priv->send_location = send_location;
+}
+
FspDataLocation *
frogr_picture_get_location (FrogrPicture *self)
{
diff --git a/src/frogr-picture.h b/src/frogr-picture.h
index d1aadd5..bdfe5ac 100644
--- a/src/frogr-picture.h
+++ b/src/frogr-picture.h
@@ -105,6 +105,10 @@ void frogr_picture_set_content_type (FrogrPicture *self,
FspContentType content_type);
FspLicense frogr_picture_get_license (FrogrPicture *self);
void frogr_picture_set_license (FrogrPicture *self, FspLicense license);
+
+gboolean frogr_picture_send_location (FrogrPicture *self);
+void frogr_picture_set_send_location (FrogrPicture *self, gboolean send_location);
+
FspDataLocation *frogr_picture_get_location (FrogrPicture *self);
void frogr_picture_set_location (FrogrPicture *self, FspDataLocation *location);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]