[gnome-photos] Query the slo:location and store it in PhotosBaseItem
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] Query the slo:location and store it in PhotosBaseItem
- Date: Mon, 16 Jan 2017 10:58:03 +0000 (UTC)
commit ecf16f5da3a3cb39d3c7c5c892ce4f42ad4f2c67
Author: Shivam Tripathi <shivam flash gmail com>
Date: Wed Oct 12 00:53:32 2016 +0530
Query the slo:location and store it in PhotosBaseItem
https://bugzilla.gnome.org/show_bug.cgi?id=747123
src/photos-base-item.c | 18 ++++++++++++++++++
src/photos-base-item.h | 2 ++
src/photos-query-builder.c | 3 ++-
src/photos-query.h | 3 ++-
4 files changed, 24 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index 96185b0..cf1e9d6 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -87,6 +87,7 @@ struct _PhotosBaseItemPrivate
gchar *filename;
gchar *id;
gchar *identifier;
+ gchar *location;
gchar *mime_type;
gchar *name;
gchar *name_fallback;
@@ -2150,6 +2151,7 @@ photos_base_item_populate_from_cursor (PhotosBaseItem *self, TrackerSparqlCursor
const gchar *flash;
const gchar *id;
const gchar *identifier;
+ const gchar *location;
const gchar *mime_type;
const gchar *mtime;
const gchar *orientation;
@@ -2179,6 +2181,9 @@ photos_base_item_populate_from_cursor (PhotosBaseItem *self, TrackerSparqlCursor
photos_utils_set_string (&priv->author, author);
g_object_notify (G_OBJECT (self), "secondary-text");
+ location = tracker_sparql_cursor_get_string (cursor, PHOTOS_QUERY_COLUMNS_LOCATION, NULL);
+ photos_utils_set_string (&priv->location, location);
+
resource_urn = tracker_sparql_cursor_get_string (cursor, PHOTOS_QUERY_COLUMNS_RESOURCE_URN, NULL);
photos_utils_set_string (&priv->resource_urn, resource_urn);
@@ -2354,6 +2359,7 @@ photos_base_item_finalize (GObject *object)
g_free (priv->filename);
g_free (priv->id);
g_free (priv->identifier);
+ g_free (priv->location);
g_free (priv->mime_type);
g_free (priv->name);
g_free (priv->name_fallback);
@@ -2919,6 +2925,18 @@ photos_base_item_get_iso_speed (PhotosBaseItem *self)
const gchar *
+photos_base_item_get_location (PhotosBaseItem *self)
+{
+ PhotosBaseItemPrivate *priv;
+
+ g_return_val_if_fail (PHOTOS_IS_BASE_ITEM (self), NULL);
+ priv = photos_base_item_get_instance_private (self);
+
+ return priv->location;
+}
+
+
+const gchar *
photos_base_item_get_mime_type (PhotosBaseItem *self)
{
PhotosBaseItemPrivate *priv;
diff --git a/src/photos-base-item.h b/src/photos-base-item.h
index f793786..cf8a1df 100644
--- a/src/photos-base-item.h
+++ b/src/photos-base-item.h
@@ -132,6 +132,8 @@ const gchar *photos_base_item_get_identifier (PhotosBaseItem *se
gdouble photos_base_item_get_iso_speed (PhotosBaseItem *self);
+const gchar *photos_base_item_get_location (PhotosBaseItem *self);
+
const gchar *photos_base_item_get_mime_type (PhotosBaseItem *self);
gint64 photos_base_item_get_mtime (PhotosBaseItem *self);
diff --git a/src/photos-query-builder.c b/src/photos-query-builder.c
index 5b84b54..7014920 100644
--- a/src/photos-query-builder.c
+++ b/src/photos-query-builder.c
@@ -188,7 +188,8 @@ photos_query_builder_query (PhotosSearchContextState *state,
"nmm:fnumber (?urn) "
"nmm:focalLength (?urn) "
"nmm:isoSpeed (?urn) "
- "nmm:flash (?urn) ",
+ "nmm:flash (?urn) "
+ "slo:location (?urn) ",
where_sparql,
tail_sparql,
NULL);
diff --git a/src/photos-query.h b/src/photos-query.h
index 3c2135a..3766fcc 100644
--- a/src/photos-query.h
+++ b/src/photos-query.h
@@ -56,7 +56,8 @@ typedef enum
PHOTOS_QUERY_COLUMNS_FNUMBER,
PHOTOS_QUERY_COLUMNS_FOCAL_LENGTH,
PHOTOS_QUERY_COLUMNS_ISO_SPEED,
- PHOTOS_QUERY_COLUMNS_FLASH
+ PHOTOS_QUERY_COLUMNS_FLASH,
+ PHOTOS_QUERY_COLUMNS_LOCATION
} PhotosQueryColumns;
typedef enum
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]