[gnome-photos/wip/rishi/collection: 14/20] Support creating BaseItems with thumbnailing turned off
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/collection: 14/20] Support creating BaseItems with thumbnailing turned off
- Date: Wed, 14 Feb 2018 00:44:19 +0000 (UTC)
commit 1aa671de780df5cf5b2d6088fbb61f9f67b60b1a
Author: Debarshi Ray <debarshir gnome org>
Date: Wed Jan 24 20:04:41 2018 +0100
Support creating BaseItems with thumbnailing turned off
A subsequent patch will directly use the BaseItem to query the
GFileInfo, instead of creating a GFile out of the URI. This is
required to transparently query the state of the thumbnail across
different BaseItem sub-classes that might have different thumbnail
caches.
To do so, various bits of the search provider need to use the BaseItem
API instead of directly parsing the TrackerSparqlCursor and creating a
GFile out of the URI. Since the search provider shouldn't initiate
thumbnailing, it's necessary to be able to create BaseItems with
thumbnailing turned off.
https://gitlab.gnome.org/GNOME/gnome-photos/issues/29
src/photos-collection-icon-watcher.c | 2 +-
src/photos-item-manager.c | 9 ++++++---
src/photos-item-manager.h | 3 ++-
3 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/photos-collection-icon-watcher.c b/src/photos-collection-icon-watcher.c
index 9cbb548a..5c8dcefd 100644
--- a/src/photos-collection-icon-watcher.c
+++ b/src/photos-collection-icon-watcher.c
@@ -177,7 +177,7 @@ photos_collection_icon_watcher_to_query_executed (GObject *source_object, GAsync
{
PhotosBaseItem *item;
- item = photos_item_manager_create_item (PHOTOS_ITEM_MANAGER (self->item_mngr), G_TYPE_NONE, cursor);
+ item = photos_item_manager_create_item (PHOTOS_ITEM_MANAGER (self->item_mngr), G_TYPE_NONE, cursor,
TRUE);
self->items = g_list_prepend (self->items, item);
}
diff --git a/src/photos-item-manager.c b/src/photos-item-manager.c
index 18136838..b343d87b 100644
--- a/src/photos-item-manager.c
+++ b/src/photos-item-manager.c
@@ -342,7 +342,7 @@ photos_item_manager_add_cursor_for_mode (PhotosItemManager *self,
}
else
{
- item = photos_item_manager_create_item (self, base_item_type, cursor);
+ item = photos_item_manager_create_item (self, base_item_type, cursor, TRUE);
if (photos_base_item_is_collection (item))
g_hash_table_insert (self->collections, g_strdup (id), g_object_ref (item));
@@ -1356,7 +1356,10 @@ photos_item_manager_clear (PhotosItemManager *self, PhotosWindowMode mode)
PhotosBaseItem *
-photos_item_manager_create_item (PhotosItemManager *self, GType base_item_type, TrackerSparqlCursor *cursor)
+photos_item_manager_create_item (PhotosItemManager *self,
+ GType base_item_type,
+ TrackerSparqlCursor *cursor,
+ gboolean create_thumbnails)
{
GType type;
PhotosBaseItem *ret_val = NULL;
@@ -1411,7 +1414,7 @@ photos_item_manager_create_item (PhotosItemManager *self, GType base_item_type,
ret_val = PHOTOS_BASE_ITEM (g_object_new (type,
"cursor", cursor,
- "failed-thumbnailing", FALSE,
+ "failed-thumbnailing", !create_thumbnails,
NULL));
out:
diff --git a/src/photos-item-manager.h b/src/photos-item-manager.h
index df2e5c1f..c3eae38a 100644
--- a/src/photos-item-manager.h
+++ b/src/photos-item-manager.h
@@ -86,7 +86,8 @@ void photos_item_manager_clear (Phot
PhotosBaseItem *photos_item_manager_create_item (PhotosItemManager *self,
GType base_item_type,
- TrackerSparqlCursor *cursor);
+ TrackerSparqlCursor *cursor,
+ gboolean create_thumbnails);
PhotosBaseItem *photos_item_manager_get_active_collection (PhotosItemManager *self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]