[gnome-photos/wip/rishi/item-manager: 2/11] item-manager: Assert that new items don't have hidden URNs



commit 1f840341202159a20fa56a710f0becb56771b05e
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Aug 15 11:46:17 2016 +0200

    item-manager: Assert that new items don't have hidden URNs

 src/photos-item-manager.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-item-manager.c b/src/photos-item-manager.c
index 993e8d5..bc24a0b 100644
--- a/src/photos-item-manager.c
+++ b/src/photos-item-manager.c
@@ -151,9 +151,13 @@ static void
 photos_item_manager_item_created (PhotosItemManager *self, const gchar *urn)
 {
   GApplication *app;
+  PhotosBaseItem *old_hidden_item;
   PhotosSearchContextState *state;
   PhotosSingleItemJob *job;
 
+  old_hidden_item = PHOTOS_BASE_ITEM (g_hash_table_lookup (self->hidden_items, urn));
+  g_return_if_fail (old_hidden_item == NULL);
+
   app = g_application_get_default ();
   state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
 


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