[gnome-photos/wip/rishi/collection: 37/39] Support creating BaseItems with thumbnailing turned off



commit 6503086dca83d0127b4aa55a38ea90f092282c86
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Jan 24 20:04:41 2018 +0100

    Support creating BaseItems with thumbnailing turned off

 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 b3072221..602e8f28 100644
--- a/src/photos-item-manager.c
+++ b/src/photos-item-manager.c
@@ -318,7 +318,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));
 
@@ -1158,7 +1158,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;
@@ -1213,7 +1216,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 708e7504..7ab2d155 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]