[gnome-photos/wip/uajain/master-fixes: 1/2] item-manager: Clear all item_mngr_chldrn base managers
- From: Umang Jain <uajain src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/uajain/master-fixes: 1/2] item-manager: Clear all item_mngr_chldrn base managers
- Date: Sat, 3 Sep 2016 23:44:57 +0000 (UTC)
commit 2402b04cd22be53202fe302298ccd4ad1a68cfa8
Author: Umang Jain <mailumangjain gmail com>
Date: Sat Sep 3 20:23:12 2016 +0530
item-manager: Clear all item_mngr_chldrn base managers
The recent change in implemention of photos_item_manager_clear
did not clear all child base managers. Apparently, exactly one
child base manager is left to be cleared according to that implemenation,
due to which g_assert_true (item == item1) fails in item_manager_hide_item.
This commit partially reverts 8d1d00232a9e62deb93ae4d4f498d0b51b3dad2e
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]