[gnome-photos/wip/rishi/item-manager: 6/8] item-manager: Adjust get/set active object
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/item-manager: 6/8] item-manager: Adjust get/set active object
- Date: Mon, 15 Aug 2016 10:50:43 +0000 (UTC)
commit aba24d63d48e5cdea2baf708f982f022fdc287ee
Author: Umang Jain <mailumangjain gmail com>
Date: Mon Aug 15 00:40:00 2016 +0200
item-manager: Adjust get/set active object
src/photos-item-manager.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/src/photos-item-manager.c b/src/photos-item-manager.c
index 2ef23c0..5a2cc0c 100644
--- a/src/photos-item-manager.c
+++ b/src/photos-item-manager.c
@@ -46,6 +46,7 @@
struct _PhotosItemManager
{
PhotosBaseManager parent_instance;
+ GObject *active_object;
GCancellable *loader_cancellable;
GHashTable *collections;
GHashTable *hidden_items;
@@ -393,7 +394,7 @@ photos_item_manager_set_active_object (PhotosBaseManager *manager, GObject *obje
g_return_val_if_fail (object != NULL, FALSE);
g_return_val_if_fail (PHOTOS_IS_BASE_ITEM (object), FALSE);
- active_item = photos_base_manager_get_active_object (manager);
+ active_item = photos_item_manager_get_active_object (self);
if (object == active_item)
goto out;
@@ -418,11 +419,12 @@ photos_item_manager_set_active_object (PhotosBaseManager *manager, GObject *obje
start_loading = TRUE;
}
- ret_val = PHOTOS_BASE_MANAGER_CLASS (photos_item_manager_parent_class)->set_active_object (manager,
object);
+ ret_val = TRUE;
/* We have already eliminated the possibility of failure. */
g_assert (ret_val == TRUE);
- active_item = photos_base_manager_get_active_object (manager);
+ self->active_object = object;
+ active_item = photos_item_manager_get_active_object (manager);
g_assert (active_item == object);
if (active_collection_changed)
@@ -552,6 +554,7 @@ photos_item_manager_class_init (PhotosItemManagerClass *class)
base_manager_class->get_where = photos_item_manager_get_where;
base_manager_class->get_object_by_id = photos_item_manager_get_object_by_id;
base_manager_class->set_active_object = photos_item_manager_set_active_object;
+ base_manager_class->get_active_object = photos_item_manager_get_active_object;
base_manager_class->remove_object_by_id = photos_item_manager_remove_object_by_id;
signals[ACTIVE_COLLECTION_CHANGED] = g_signal_new ("active-collection-changed",
@@ -741,6 +744,13 @@ photos_item_manager_create_item (PhotosItemManager *self, TrackerSparqlCursor *c
}
+GObject*
+photos_item_manager_get_active_object (PhotosItemManager *self)
+{
+ return self->active_object;
+}
+
+
PhotosBaseItem *
photos_item_manager_get_active_collection (PhotosItemManager *self)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]