[gnome-photos/wip/uajain/master-fixes: 1/3] item-manager: Clear mode specific items from all child base managers



commit 56e287d2fb8fe6f927061ad99dcec761b213f463
Author: Umang Jain <mailumangjain gmail com>
Date:   Sat Sep 3 20:23:12 2016 +0530

    item-manager: Clear mode specific items from all child base managers
    
    The recent change in implemention of photos_item_manager_clear
    did not clear mode specific items from all child base managers.
    Apparently, exactly one child base manager was left to be cleared
    according to that implemenation, due to which g_assert_true (item == item1)
    fails in item_manager_hide_item when the item is deleted under "Favorite"
    tab.
    
    This commit partially reverts 8d1d00232a9e62deb93ae4d4f498d0b51b3dad2e
    
    https://bugzilla.gnome.org/show_bug.cgi?id=770823

 src/photos-item-manager.c |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)
---
diff --git a/src/photos-item-manager.c b/src/photos-item-manager.c
index 09e089d..d19c5b6 100644
--- a/src/photos-item-manager.c
+++ b/src/photos-item-manager.c
@@ -852,24 +852,20 @@ photos_item_manager_clear (PhotosItemManager *self, PhotosWindowMode mode)
       PhotosBaseItem *item = NULL;
       guint i;
 
-      for (i = 1; self->item_mngr_chldrn[i] != NULL; i++)
+      for (i = 0; self->item_mngr_chldrn[i] != NULL; i++)
         {
           if (item_mngr_chld == self->item_mngr_chldrn[i])
             continue;
 
           item = PHOTOS_BASE_ITEM (photos_base_manager_get_object_by_id (self->item_mngr_chldrn[i], id));
           if (item != NULL)
-            break;
-        }
-
-      if (item != NULL)
-        {
-          const gchar *id1;
-
-          id1 = photos_filterable_get_id (PHOTOS_FILTERABLE (item));
-          g_assert_cmpstr (id, ==, id1);
+            {
+              const gchar *id1;
+              id1 = photos_filterable_get_id (PHOTOS_FILTERABLE (item));
+              g_assert_cmpstr (id, ==, id1);
 
-          photos_base_manager_remove_object_by_id (self->item_mngr_chldrn[0], id);
+              photos_base_manager_remove_object_by_id (self->item_mngr_chldrn[i], id);
+            }
         }
     }
 


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