[gnome-photos/wip/rishi/collection: 12/16] query: Loosen the requirement to provide a SearchContextState
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/collection: 12/16] query: Loosen the requirement to provide a SearchContextState
- Date: Mon, 4 Sep 2017 18:34:12 +0000 (UTC)
commit 12950a62a58d74565f9dad308cf009db450ced0b
Author: Debarshi Ray <debarshir gnome org>
Date: Mon Sep 4 16:18:59 2017 +0200
query: Loosen the requirement to provide a SearchContextState
Currently, the SearchContextState (or the Source) is only used by
TrackerController, and is not used by every SPARQL query. A subsequent
commit will replace raw strings with Query objects in the TrackerQueue
API, and this is a prerequisite for that.
src/photos-query.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/photos-query.c b/src/photos-query.c
index 83320ed..9e4132f 100644
--- a/src/photos-query.c
+++ b/src/photos-query.c
@@ -37,14 +37,18 @@ const gchar *PHOTOS_QUERY_LOCAL_COLLECTIONS_IDENTIFIER = "photos:collection:loca
PhotosQuery *
photos_query_new (PhotosSearchContextState *state, gchar *sparql)
{
- GObject *active_object;
PhotosQuery *query;
query = g_slice_new0 (PhotosQuery);
- active_object = photos_base_manager_get_active_object (state->src_mngr);
- if (active_object != NULL)
- query->source = PHOTOS_SOURCE (g_object_ref (active_object));
+ if (state != NULL)
+ {
+ GObject *active_object;
+
+ active_object = photos_base_manager_get_active_object (state->src_mngr);
+ if (active_object != NULL)
+ query->source = PHOTOS_SOURCE (g_object_ref (active_object));
+ }
query->sparql = sparql;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]