[gnome-photos/wip/rishi/item-manager: 5/11] Use photos_item_manager_(un)hide_item to handle deletes



commit eca149227ea311f5e79d82164a1a2025274b8fe4
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Aug 15 11:53:27 2016 +0200

    Use photos_item_manager_(un)hide_item to handle deletes

 src/photos-delete-notification.c |    6 +++---
 src/photos-preview-nav-buttons.c |    2 +-
 src/photos-selection-toolbar.c   |    8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/photos-delete-notification.c b/src/photos-delete-notification.c
index 32e4645..e4eb066 100644
--- a/src/photos-delete-notification.c
+++ b/src/photos-delete-notification.c
@@ -26,9 +26,9 @@
 #include <gtk/gtk.h>
 
 #include "photos-base-item.h"
-#include "photos-base-manager.h"
 #include "photos-delete-notification.h"
 #include "photos-icons.h"
+#include "photos-item-manager.h"
 #include "photos-notification-manager.h"
 #include "photos-search-context.h"
 
@@ -115,8 +115,8 @@ photos_delete_notification_undo_clicked (PhotosDeleteNotification *self)
 
   for (l = self->items; l != NULL; l = l->next)
     {
-      GObject *item = G_OBJECT (l->data);
-      photos_base_manager_add_object (self->item_mngr, item);
+      PhotosBaseItem *item = PHOTOS_BASE_ITEM (l->data);
+      photos_item_manager_unhide_item (PHOTOS_ITEM_MANAGER (self->item_mngr), item);
     }
 
   photos_delete_notification_destroy (self);
diff --git a/src/photos-preview-nav-buttons.c b/src/photos-preview-nav-buttons.c
index 166e8d8..ff5467f 100644
--- a/src/photos-preview-nav-buttons.c
+++ b/src/photos-preview-nav-buttons.c
@@ -101,7 +101,7 @@ photos_preview_nav_buttons_delete (PhotosPreviewNavButtons *self)
     photos_mode_controller_go_back (self->mode_cntrlr);
 
   items = g_list_prepend (items, g_object_ref (item));
-  photos_base_manager_remove_object (self->item_mngr, G_OBJECT (item));
+  photos_item_manager_hide_item (PHOTOS_ITEM_MANAGER (self->item_mngr), item);
   photos_delete_notification_new (items);
   g_list_free_full (items, g_object_unref);
 }
diff --git a/src/photos-selection-toolbar.c b/src/photos-selection-toolbar.c
index 2c6090a..fd8bae0 100644
--- a/src/photos-selection-toolbar.c
+++ b/src/photos-selection-toolbar.c
@@ -31,9 +31,9 @@
 #include <glib/gi18n.h>
 
 #include "photos-base-item.h"
-#include "photos-base-manager.h"
 #include "photos-delete-notification.h"
 #include "photos-icons.h"
+#include "photos-item-manager.h"
 #include "photos-organize-collection-dialog.h"
 #include "photos-search-context.h"
 #include "photos-selection-controller.h"
@@ -118,13 +118,13 @@ photos_selection_toolbar_delete (PhotosSelectionToolbar *self)
       items = g_list_prepend (items, g_object_ref (item));
     }
 
-  /* Removing an item from the item manager changes the selection, so
-   * we can't use the selection while removing items.
+  /* Hiding an item from the item manager changes the selection, so we
+   * can't use the selection while removing items.
    */
   for (l = items; l != NULL; l = l->next)
     {
       PhotosBaseItem *item = PHOTOS_BASE_ITEM (l->data);
-      photos_base_manager_remove_object (self->item_mngr, G_OBJECT (item));
+      photos_item_manager_hide_item (PHOTOS_ITEM_MANAGER (self->item_mngr), item);
     }
 
   photos_delete_notification_new (items);


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