Commit a56c4247 authored by Debarshi Ray's avatar Debarshi Ray

Add PhotosSearchContext and make PhotosApplication implement it

We want to split the application into two search contexts - one is for
searches initiated from within the application, and the other is for
searches initiated from gnome-shell.

For that to happen certain classes which were singleton, and hence
global to the entire application, now has to have a separate instance
for each context. Each context will, therefore, have a state that
encapsulates the instances of these classes that correspond to it.

Currently, PhotosApplication is the only context. The future
PhotosShellSearchProvider will be another implementation.
parent 15a6a57f
......@@ -163,6 +163,8 @@ gnome_photos_SOURCES = \
photos-query-builder.c \
photos-remote-display-manager.c \
photos-remote-display-manager.h \
photos-search-context.c \
photos-search-context.h \
photos-search-controller.c \
photos-search-controller.h \
photos-search-match.c \
......
......@@ -44,6 +44,7 @@
#include "photos-mode-controller.h"
#include "photos-properties-dialog.h"
#include "photos-resources.h"
#include "photos-search-context.h"
#include "photos-source-manager.h"
......@@ -66,13 +67,18 @@ struct _PhotosApplicationPrivate
GomMiner *flickr_miner;
GtkWidget *main_window;
PhotosBaseManager *item_mngr;
PhotosBaseManager *src_mngr;
PhotosCameraCache *camera_cache;
PhotosModeController *mode_cntrlr;
PhotosSearchContextState *state;
};
static void photos_application_search_context_iface_init (PhotosSearchContextInterface *iface);
G_DEFINE_TYPE_WITH_PRIVATE (PhotosApplication, photos_application, GTK_TYPE_APPLICATION)
G_DEFINE_TYPE_WITH_CODE (PhotosApplication, photos_application, GTK_TYPE_APPLICATION,
G_ADD_PRIVATE (PhotosApplication)
G_IMPLEMENT_INTERFACE (PHOTOS_TYPE_SEARCH_CONTEXT,
photos_application_search_context_iface_init));
enum
......@@ -155,6 +161,14 @@ photos_application_fullscreen (PhotosApplication *self, GVariant *parameter)
}
static PhotosSearchContextState *
photos_application_get_state (PhotosSearchContext *context)
{
PhotosApplication *self = PHOTOS_APPLICATION (context);
return self->priv->state;
}
static void
photos_application_open_current (PhotosApplication *self)
{
......@@ -272,10 +286,10 @@ photos_application_refresh_miners (PhotosApplication *self)
{
PhotosApplicationPrivate *priv = self->priv;
if (photos_source_manager_has_provider_type (PHOTOS_SOURCE_MANAGER (priv->src_mngr), "facebook"))
if (photos_source_manager_has_provider_type (PHOTOS_SOURCE_MANAGER (priv->state->src_mngr), "facebook"))
photos_application_refresh_miner_now (self, priv->facebook_miner);
if (photos_source_manager_has_provider_type (PHOTOS_SOURCE_MANAGER (priv->src_mngr), "flickr"))
if (photos_source_manager_has_provider_type (PHOTOS_SOURCE_MANAGER (priv->state->src_mngr), "flickr"))
photos_application_refresh_miner_now (self, priv->flickr_miner);
}
......@@ -359,12 +373,12 @@ photos_application_start_miners (PhotosApplication *self)
photos_application_refresh_miners (self);
g_signal_connect_object (priv->src_mngr,
g_signal_connect_object (priv->state->src_mngr,
"object-added",
G_CALLBACK (photos_application_refresh_miners),
self,
G_CONNECT_SWAPPED);
g_signal_connect_object (priv->src_mngr,
g_signal_connect_object (priv->state->src_mngr,
"object-removed",
G_CALLBACK (photos_application_refresh_miners),
self,
......@@ -470,7 +484,6 @@ photos_application_startup (GApplication *application)
NULL);
priv->item_mngr = photos_item_manager_dup_singleton ();
priv->src_mngr = photos_source_manager_dup_singleton ();
/* A dummy reference to keep it alive during the lifetime of the
* application.
......@@ -611,10 +624,15 @@ photos_application_dispose (GObject *object)
g_clear_object (&priv->facebook_miner);
g_clear_object (&priv->flickr_miner);
g_clear_object (&priv->item_mngr);
g_clear_object (&priv->src_mngr);
g_clear_object (&priv->camera_cache);
g_clear_object (&priv->mode_cntrlr);
if (priv->state != NULL)
{
photos_search_context_state_free (priv->state);
priv->state = NULL;
}
G_OBJECT_CLASS (photos_application_parent_class)->dispose (object);
}
......@@ -622,8 +640,14 @@ photos_application_dispose (GObject *object)
static void
photos_application_init (PhotosApplication *self)
{
PhotosApplicationPrivate *priv;
self->priv = photos_application_get_instance_private (self);
priv = self->priv;
eog_debug_init ();
priv->state = photos_search_context_state_new (PHOTOS_SEARCH_CONTEXT (self));
}
......@@ -642,6 +666,13 @@ photos_application_class_init (PhotosApplicationClass *class)
}
static void
photos_application_search_context_iface_init (PhotosSearchContextInterface *iface)
{
iface->get_state = photos_application_get_state;
}
GtkApplication *
photos_application_new (void)
{
......
......@@ -40,6 +40,7 @@
#include "photos-icons.h"
#include "photos-print-operation.h"
#include "photos-query.h"
#include "photos-search-context.h"
#include "photos-selection-controller.h"
#include "photos-single-item-job.h"
#include "photos-utils.h"
......@@ -1288,10 +1289,19 @@ photos_base_item_print (PhotosBaseItem *self, GtkWidget *toplevel)
void
photos_base_item_refresh (PhotosBaseItem *self)
{
GApplication *app;
PhotosSearchContextState *state;
PhotosSingleItemJob *job;
app = g_application_get_default ();
state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
job = photos_single_item_job_new (self->priv->id);
photos_single_item_job_run (job, PHOTOS_QUERY_FLAGS_NONE, photos_base_item_refresh_executed, g_object_ref (self));
photos_single_item_job_run (job,
state,
PHOTOS_QUERY_FLAGS_NONE,
photos_base_item_refresh_executed,
g_object_ref (self));
g_object_unref (job);
}
......
/*
* Photos - access, organize and share your photos on GNOME
* Copyright © 2013 Red Hat, Inc.
* Copyright © 2013, 2014 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -25,6 +25,7 @@
#include "photos-camera-cache.h"
#include "photos-query-builder.h"
#include "photos-search-context.h"
#include "photos-tracker-queue.h"
......@@ -188,8 +189,10 @@ photos_camera_cache_get_camera_async (PhotosCameraCache *self,
gpointer user_data)
{
PhotosCameraCachePrivate *priv = self->priv;
GApplication *app;
GTask *task;
PhotosQuery *query;
PhotosSearchContextState *state;
const gchar *camera;
task = g_task_new (self, cancellable, callback, user_data);
......@@ -210,7 +213,10 @@ photos_camera_cache_get_camera_async (PhotosCameraCache *self,
goto out;
}
query = photos_query_builder_equipment_query (id);
app = g_application_get_default ();
state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
query = photos_query_builder_equipment_query (state, id);
photos_tracker_queue_select (priv->queue,
query->sparql,
cancellable,
......
......@@ -34,6 +34,7 @@
#include "photos-item-manager.h"
#include "photos-query.h"
#include "photos-query-builder.h"
#include "photos-search-context.h"
#include "photos-single-item-job.h"
#include "photos-tracker-queue.h"
#include "photos-utils.h"
......@@ -186,12 +187,17 @@ static void
photos_collection_icon_watcher_finished (PhotosCollectionIconWatcher *self)
{
PhotosCollectionIconWatcherPrivate *priv = self->priv;
GApplication *app;
GList *l;
GList *to_query = NULL;
PhotosSearchContextState *state;
if (priv->urns == NULL)
return;
app = g_application_get_default ();
state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
priv->to_query_remaining = 0;
for (l = priv->urns; l != NULL; l = l->next)
......@@ -222,6 +228,7 @@ photos_collection_icon_watcher_finished (PhotosCollectionIconWatcher *self)
job = photos_single_item_job_new (urn);
photos_single_item_job_run (job,
state,
PHOTOS_QUERY_FLAGS_UNFILTERED,
photos_collection_icon_watcher_to_query_executed,
g_object_ref (self));
......@@ -299,7 +306,9 @@ static void
photos_collection_icon_watcher_start (PhotosCollectionIconWatcher *self)
{
PhotosCollectionIconWatcherPrivate *priv = self->priv;
GApplication *app;
PhotosQuery *query;
PhotosSearchContextState *state;
const gchar *id;
photos_collection_icon_watcher_clear (self);
......@@ -310,8 +319,11 @@ photos_collection_icon_watcher_start (PhotosCollectionIconWatcher *self)
if (priv->collection == NULL)
return;
app = g_application_get_default ();
state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
id = photos_filterable_get_id (PHOTOS_FILTERABLE (priv->collection));
query = photos_query_builder_collection_icon_query (id);
query = photos_query_builder_collection_icon_query (state, id);
photos_tracker_queue_select (priv->queue,
query->sparql,
NULL,
......
......@@ -47,26 +47,6 @@ photos_collection_manager_get_where (PhotosBaseManager *mngr, gint flags)
}
static GObject *
photos_collection_manager_constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params)
{
static GObject *self = NULL;
if (self == NULL)
{
self = G_OBJECT_CLASS (photos_collection_manager_parent_class)->constructor (type,
n_construct_params,
construct_params);
g_object_add_weak_pointer (self, (gpointer) &self);
return self;
}
return g_object_ref (self);
}
static void
photos_collection_manager_init (PhotosCollectionManager *self)
{
......@@ -76,16 +56,14 @@ photos_collection_manager_init (PhotosCollectionManager *self)
static void
photos_collection_manager_class_init (PhotosCollectionManagerClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
PhotosBaseManagerClass *base_manager_class = PHOTOS_BASE_MANAGER_CLASS (class);
object_class->constructor = photos_collection_manager_constructor;
base_manager_class->get_where = photos_collection_manager_get_where;
}
PhotosBaseManager *
photos_collection_manager_dup_singleton (void)
photos_collection_manager_new (void)
{
return g_object_new (PHOTOS_TYPE_COLLECTION_MANAGER, NULL);
}
/*
* Photos - access, organize and share your photos on GNOME
* Copyright © 2012, 2013 Red Hat, Inc.
* Copyright © 2012, 2013, 2014 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -68,7 +68,7 @@ struct _PhotosCollectionManagerClass
GType photos_collection_manager_get_type (void) G_GNUC_CONST;
PhotosBaseManager *photos_collection_manager_dup_singleton (void);
PhotosBaseManager *photos_collection_manager_new (void);
G_END_DECLS
......
/*
* Photos - access, organize and share your photos on GNOME
* Copyright © 2013 Red Hat, Inc.
* Copyright © 2013, 2014 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -25,12 +25,14 @@
#include "config.h"
#include <gio/gio.h>
#include <glib.h>
#include <tracker-sparql.h>
#include "photos-create-collection-job.h"
#include "photos-query.h"
#include "photos-query-builder.h"
#include "photos-search-context.h"
#include "photos-tracker-queue.h"
......@@ -193,7 +195,9 @@ photos_create_collection_job_run (PhotosCreateCollectionJob *self,
gpointer user_data)
{
PhotosCreateCollectionJobPrivate *priv = self->priv;
GApplication *app;
PhotosQuery *query;
PhotosSearchContextState *state;
if (G_UNLIKELY (priv->queue == NULL))
{
......@@ -205,7 +209,10 @@ photos_create_collection_job_run (PhotosCreateCollectionJob *self,
priv->callback = callback;
priv->user_data = user_data;
query = photos_query_builder_create_collection_query (priv->name);
app = g_application_get_default ();
state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
query = photos_query_builder_create_collection_query (state, priv->name);
photos_tracker_queue_update_blank (priv->queue,
query->sparql,
NULL,
......
/*
* Photos - access, organize and share your photos on GNOME
* Copyright © 2013 Red Hat, Inc.
* Copyright © 2013, 2014 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -25,12 +25,14 @@
#include "config.h"
#include <gio/gio.h>
#include <glib.h>
#include <tracker-sparql.h>
#include "photos-delete-item-job.h"
#include "photos-query.h"
#include "photos-query-builder.h"
#include "photos-search-context.h"
#include "photos-tracker-queue.h"
......@@ -159,7 +161,9 @@ photos_delete_item_job_run (PhotosDeleteItemJob *self,
gpointer user_data)
{
PhotosDeleteItemJobPrivate *priv = self->priv;
GApplication *app;
PhotosQuery *query;
PhotosSearchContextState *state;
if (G_UNLIKELY (priv->queue == NULL))
{
......@@ -171,7 +175,10 @@ photos_delete_item_job_run (PhotosDeleteItemJob *self,
priv->callback = callback;
priv->user_data = user_data;
query = photos_query_builder_delete_resource_query (priv->urn);
app = g_application_get_default ();
state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
query = photos_query_builder_delete_resource_query (state, priv->urn);
photos_tracker_queue_update (priv->queue,
query->sparql,
NULL,
......
......@@ -25,13 +25,11 @@
#include "config.h"
#include <glib.h>
#include <gio/gio.h>
#include "photos-base-view.h"
#include "photos-dropdown.h"
#include "photos-source-manager.h"
#include "photos-search-match-manager.h"
#include "photos-search-type-manager.h"
#include "photos-search-context.h"
struct _PhotosDropdownPrivate
......@@ -82,15 +80,20 @@ static void
photos_dropdown_init (PhotosDropdown *self)
{
PhotosDropdownPrivate *priv;
GApplication *app;
GtkStyleContext *context;
GtkWidget *frame;
PhotosSearchContextState *state;
self->priv = photos_dropdown_get_instance_private (self);
priv = self->priv;
priv->srch_mtch_mngr = photos_search_match_manager_dup_singleton ();
priv->srch_typ_mngr = photos_search_type_manager_dup_singleton ();
priv->src_mngr = photos_source_manager_dup_singleton ();
app = g_application_get_default ();
state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
priv->srch_mtch_mngr = g_object_ref (state->srch_mtch_mngr);
priv->srch_typ_mngr = g_object_ref (state->srch_typ_mngr);
priv->src_mngr = g_object_ref (state->src_mngr);
priv->match_view = photos_base_view_new (priv->srch_mtch_mngr);
priv->source_view = photos_base_view_new (priv->src_mngr);
......
......@@ -27,6 +27,7 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gegl.h>
#include <gio/gio.h>
#include <glib/gi18n.h>
#include "photos-collection-manager.h"
......@@ -40,6 +41,7 @@
#include "photos-search-controller.h"
#include "photos-selection-toolbar.h"
#include "photos-spinner-box.h"
#include "photos-search-context.h"
#include "photos-search-type.h"
#include "photos-search-type-manager.h"
#include "photos-source.h"
......@@ -610,12 +612,15 @@ photos_embed_init (PhotosEmbed *self)
{
PhotosEmbedPrivate *priv;
GApplication *app;
PhotosSearchContextState *state;
gboolean querying;
self->priv = photos_embed_get_instance_private (self);
priv = self->priv;
app = g_application_get_default ();
state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
priv->search_action = g_action_map_lookup_action (G_ACTION_MAP (app), "search");
g_signal_connect_swapped (app, "window-added", G_CALLBACK (photos_embed_window_added), self);
......@@ -685,22 +690,22 @@ photos_embed_init (PhotosEmbed *self)
G_CALLBACK (photos_embed_query_status_changed),
self);
priv->col_mngr = photos_collection_manager_dup_singleton ();
priv->col_mngr = g_object_ref (state->col_mngr);
g_signal_connect (priv->col_mngr, "active-changed", G_CALLBACK (photos_embed_active_changed), self);
priv->item_mngr = photos_item_manager_dup_singleton ();
g_signal_connect (priv->item_mngr, "active-changed", G_CALLBACK (photos_embed_active_changed), self);
priv->src_mngr = photos_source_manager_dup_singleton ();
priv->src_mngr = g_object_ref (state->src_mngr);
g_signal_connect_swapped (priv->src_mngr, "active-changed", G_CALLBACK (photos_embed_search_changed), self);
priv->srch_mngr = photos_search_type_manager_dup_singleton ();
priv->srch_mngr = g_object_ref (state->srch_typ_mngr);
g_signal_connect_swapped (priv->srch_mngr, "active-changed", G_CALLBACK (photos_embed_search_changed), self);
querying = photos_tracker_controller_get_query_status (priv->trk_ovrvw_cntrlr);
photos_embed_query_status_changed (self, querying);
priv->srch_cntrlr = photos_search_controller_dup_singleton ();
priv->srch_cntrlr = g_object_ref (state->srch_cntrlr);
g_signal_connect_swapped (priv->srch_cntrlr,
"search-string-changed",
G_CALLBACK (photos_embed_search_changed),
......
......@@ -25,11 +25,13 @@
#include "config.h"
#include <gio/gio.h>
#include <glib/gi18n.h>
#include "photos-empty-results-box.h"
#include "photos-enums.h"
#include "photos-icons.h"
#include "photos-search-context.h"
#include "photos-source-manager.h"
......@@ -272,11 +274,16 @@ static void
photos_empty_results_box_init (PhotosEmptyResultsBox *self)
{
PhotosEmptyResultsBoxPrivate *priv;
GApplication *app;
PhotosSearchContextState *state;
self->priv = photos_empty_results_box_get_instance_private (self);
priv = self->priv;
priv->src_mngr = photos_source_manager_dup_singleton ();
app = g_application_get_default ();
state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
priv->src_mngr = g_object_ref (state->src_mngr);
}
......
/*
* Photos - access, organize and share your photos on GNOME
* Copyright © 2013 Álvaro Peña
* Copyright © 2014 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -33,9 +34,10 @@
#include <goa/goa.h>
#include <libgnome-desktop/gnome-desktop-thumbnail.h>
#include "photos-base-manager.h"
#include "photos-facebook-item.h"
#include "photos-search-context.h"
#include "photos-source.h"
#include "photos-source-manager.h"
#include "photos-utils.h"
......@@ -234,11 +236,16 @@ static void
photos_facebook_item_init (PhotosFacebookItem *self)
{
PhotosFacebookItemPrivate *priv;
GApplication *app;
PhotosSearchContextState *state;
self->priv = photos_facebook_item_get_instance_private (self);
priv = self->priv;
priv->src_mngr = photos_source_manager_dup_singleton ();
app = g_application_get_default ();
state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
priv->src_mngr = g_object_ref (state->src_mngr);
}
......
......@@ -28,13 +28,13 @@
#include <glib.h>
#include <tracker-sparql.h>
#include "photos-collection-manager.h"
#include "photos-fetch-collection-state-job.h"
#include "photos-fetch-collections-job.h"
#include "photos-filterable.h"
#include "photos-item-manager.h"
#include "photos-query.h"
#include "photos-query-builder.h"
#include "photos-search-context.h"
#include "photos-selection-controller.h"
......@@ -219,16 +219,21 @@ static void
photos_fetch_collection_state_job_init (PhotosFetchCollectionStateJob *self)
{
PhotosFetchCollectionStateJobPrivate *priv = self->priv;
GApplication *app;
PhotosSearchContextState *state;
self->priv = photos_fetch_collection_state_job_get_instance_private (self);
priv = self->priv;
app = g_application_get_default ();
state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
priv->collections_for_items = g_hash_table_new_full (g_str_hash,
g_str_equal,
g_free,
photos_fetch_collection_state_job_value_destroy_func);
priv->col_mngr = photos_collection_manager_dup_singleton ();
priv->col_mngr = g_object_ref (state->col_mngr);
priv->item_mngr = photos_item_manager_dup_singleton ();
priv->sel_cntrlr = photos_selection_controller_dup_singleton ();
}
......
/*
* Photos - access, organize and share your photos on GNOME
* Copyright © 2013 Red Hat, Inc.
* Copyright © 2013, 2014 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -25,12 +25,14 @@
#include "config.h"
#include <gio/gio.h>
#include <glib.h>
#include <tracker-sparql.h>
#include "photos-fetch-collections-job.h"
#include "photos-query.h"
#include "photos-query-builder.h"
#include "photos-search-context.h"
#include "photos-tracker-queue.h"
......@@ -215,7 +217,9 @@ photos_fetch_collections_job_run (PhotosFetchCollectionsJob *self,
gpointer user_data)
{
PhotosFetchCollectionsJobPrivate *priv = self->priv;
GApplication *app;
PhotosQuery *query;
PhotosSearchContextState *state;
if (G_UNLIKELY (priv->queue == NULL))
{
......@@ -227,7 +231,10 @@ photos_fetch_collections_job_run (PhotosFetchCollectionsJob *self,
priv->callback = callback;
priv->user_data = user_data;
query = photos_query_builder_fetch_collections_query (priv->urn);
app = g_application_get_default ();
state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
query = photos_query_builder_fetch_collections_query (state, priv->urn);
photos_tracker_queue_select (priv->queue,
query->sparql,
NULL,
......
/*
* Photos - access, organize and share your photos on GNOME
* Copyright © 2013 Red Hat, Inc.
* Copyright © 2013, 2014 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -34,9 +34,10 @@
#include <grilo.h>
#include <libgnome-desktop/gnome-desktop-thumbnail.h>
#include "photos-base-manager.h"
#include "photos-flickr-item.h"
#include "photos-search-context.h"
#include "photos-source.h"
#include "photos-source-manager.h"
#include "photos-utils.h"
......@@ -338,11 +339,16 @@ static void
photos_flickr_item_init (PhotosFlickrItem *self)
{
PhotosFlickrItemPrivate *priv;
GApplication *app;
PhotosSearchContextState *state;
self->priv = photos_flickr_item_get_instance_private (self);
priv = self->priv;
priv->src_mngr = photos_source_manager_dup_singleton ();
app = g_application_get_default ();
state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
priv->src_mngr = g_object_ref (state->src_mngr);
}
......
......@@ -28,12 +28,12 @@
#include <glib.h>
#include <tracker-sparql.h>
#include "photos-collection-manager.h"
#include "photos-item-manager.h"
#include "photos-local-item.h"
#include "photos-facebook-item.h"
#include "photos-flickr-item.h"
#include "photos-query.h"
#include "photos-search-context.h"
#include "photos-single-item-job.h"
#include "photos-tracker-change-event.h"
#include "photos-tracker-change-monitor.h"
......@@ -68,10 +68,16 @@ photos_item_manager_item_created_executed (TrackerSparqlCursor *cursor, gpointer
static void
photos_item_manager_item_created (PhotosItemManager *self, const gchar *urn)
{
GApplication *app;
PhotosSearchContextState *state;
PhotosSingleItemJob *job;
app = g_application_get_default ();
state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
job = photos_single_item_job_new (urn);
photos_single_item_job_run (job,
state,
PHOTOS_QUERY_FLAGS_NONE,
photos_item_manager_item_created_executed,
g_object_ref (self));
......@@ -215,12 +221,17 @@ static void
photos_item_manager_init (PhotosItemManager *self)
{
PhotosItemManagerPrivate *priv = self->priv;
GApplication *app;
PhotosSearchContextState *state;
self->priv = photos_item_manager_get_instance_private (self);
priv = self->priv;
app = g_application_get_default ();
state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
priv->collection_path = g_queue_new ();
priv->col_mngr = photos_collection_manager_dup_singleton ();
priv->col_mngr = g_object_ref (state->col_mngr);
priv->monitor = photos_tracker_change_monitor_dup_singleton (NULL, NULL);
if (G_LIKELY (priv->monitor != NULL))
......