[gnome-photos/wip/rishi/item-manager: 7/8] item-manager: adjust remove object vfunc



commit 14818c12e08f96e5945ac6d04108a28ee037beee
Author: Umang Jain <mailumangjain gmail com>
Date:   Sun Jul 31 03:10:12 2016 +0530

    item-manager: adjust remove object vfunc

 src/photos-item-manager.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-item-manager.c b/src/photos-item-manager.c
index 04853b1..2e58dce 100644
--- a/src/photos-item-manager.c
+++ b/src/photos-item-manager.c
@@ -323,6 +323,7 @@ photos_item_manager_remove_object_by_id (PhotosBaseManager *mngr, const gchar *i
 {
   PhotosItemManager *self = PHOTOS_ITEM_MANAGER (mngr);
   gpointer *collection;
+  guint i;
 
   if (id == NULL)
     goto end;
@@ -334,7 +335,16 @@ photos_item_manager_remove_object_by_id (PhotosBaseManager *mngr, const gchar *i
   g_hash_table_remove (self->collections, id);
 
  end:
-  PHOTOS_BASE_MANAGER_CLASS (photos_item_manager_parent_class)->remove_object_by_id (mngr, id);
+  for (i = 0; self->item_mngr_chldrn[i] != NULL; i++)
+    {
+      PhotosBaseItem *item;
+
+      item = PHOTOS_BASE_ITEM (photos_base_manager_get_object_by_id (self->item_mngr_chldrn[i], id));
+      if (item != NULL)
+        break;
+    }
+
+  PHOTOS_BASE_MANAGER_CLASS (photos_item_manager_parent_class)->remove_object_by_id 
(self->item_mngr_chldrn[i], id);
 }
 
 


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