[gnome-photos/wip/rishi/collection: 16/19] query-builder: Add photos_query_builder_fetch_collections_local



commit 6b54936956905528a9c6635219abd12a23bad406
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Feb 6 00:39:29 2018 +0100

    query-builder: Add photos_query_builder_fetch_collections_local
    
    This is meant to construct a query that will fetch all local
    collections.
    
    https://gitlab.gnome.org/GNOME/gnome-photos/issues/29

 src/photos-query-builder.c | 19 +++++++++++++++++++
 src/photos-query-builder.h |  2 ++
 2 files changed, 21 insertions(+)
---
diff --git a/src/photos-query-builder.c b/src/photos-query-builder.c
index 983dbe5d..ce0af443 100644
--- a/src/photos-query-builder.c
+++ b/src/photos-query-builder.c
@@ -281,6 +281,25 @@ photos_query_builder_fetch_collections_for_urn_query (PhotosSearchContextState *
 }
 
 
+PhotosQuery *
+photos_query_builder_fetch_collections_local (PhotosSearchContextState *state)
+{
+  PhotosQuery *query;
+  g_autofree gchar *sparql = NULL;
+
+  sparql = photos_query_builder_query (state,
+                                       TRUE,
+                                       PHOTOS_QUERY_FLAGS_COLLECTIONS
+                                       | PHOTOS_QUERY_FLAGS_LOCAL
+                                       | PHOTOS_QUERY_FLAGS_UNLIMITED,
+                                       NULL)
+
+  query = photos_query_new (NULL, sparql);
+
+  return query;
+}
+
+
 PhotosQuery *
 photos_query_builder_global_query (PhotosSearchContextState *state,
                                    gint flags,
diff --git a/src/photos-query-builder.h b/src/photos-query-builder.h
index 3703fe8f..c21b1932 100644
--- a/src/photos-query-builder.h
+++ b/src/photos-query-builder.h
@@ -44,6 +44,8 @@ PhotosQuery  *photos_query_builder_equipment_query (PhotosSearchContextState *st
 PhotosQuery  *photos_query_builder_fetch_collections_for_urn_query (PhotosSearchContextState *state,
                                                                     const gchar *resource);
 
+PhotosQuery  *photos_query_builder_fetch_collections_local (PhotosSearchContextState *state);
+
 PhotosQuery  *photos_query_builder_global_query        (PhotosSearchContextState *state,
                                                         gint flags,
                                                         PhotosOffsetController *offset_cntrlr);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]