[gnome-photos] query-builder: Add photos_query_builder_update_mtime_query
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] query-builder: Add photos_query_builder_update_mtime_query
- Date: Tue, 2 Apr 2013 12:46:11 +0000 (UTC)
commit 6421c632acd1516f3239d7f0be839f283ac58516
Author: Debarshi Ray <debarshir gnome org>
Date: Sat Mar 30 00:14:15 2013 +0100
query-builder: Add photos_query_builder_update_mtime_query
src/photos-query-builder.c | 20 ++++++++++++++++++++
src/photos-query-builder.h | 2 ++
2 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-query-builder.c b/src/photos-query-builder.c
index b0586f7..67da6a3 100644
--- a/src/photos-query-builder.c
+++ b/src/photos-query-builder.c
@@ -268,6 +268,26 @@ photos_query_builder_single_query (gint flags, const gchar *resource)
}
+PhotosQuery *
+photos_query_builder_update_mtime_query (const gchar *resource)
+{
+ GTimeVal tv;
+ gchar *sparql;
+ gchar *time;
+ gint64 timestamp;
+
+ timestamp = g_get_real_time () / G_USEC_PER_SEC;
+ tv.tv_sec = timestamp;
+ tv.tv_usec = 0;
+ time = g_time_val_to_iso8601 (&tv);
+
+ sparql = g_strdup_printf ("INSERT OR REPLACE { <%s> nie:contentLastModified \"%s\" }", resource, time);
+ g_free (time);
+
+ return photos_query_new (sparql);
+}
+
+
gchar *
photos_query_builder_filter_local (void)
{
diff --git a/src/photos-query-builder.h b/src/photos-query-builder.h
index e92ff24..fb96505 100644
--- a/src/photos-query-builder.h
+++ b/src/photos-query-builder.h
@@ -43,6 +43,8 @@ PhotosQuery *photos_query_builder_global_query (void);
PhotosQuery *photos_query_builder_single_query (gint flags, const gchar *resource);
+PhotosQuery *photos_query_builder_update_mtime_query (const gchar *resource);
+
gchar *photos_query_builder_filter_local (void);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]