[gnome-photos/wip/rishi/item-manager: 8/11] base-manager: Make get_objects a virtual method



commit 36ca1d3df69b51b13ec77d5a80a5a1be9488d77a
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Aug 19 21:05:59 2016 +0200

    base-manager: Make get_objects a virtual method
    
    This is required to split PhotosItemManager to have a separate child
    manager for each mode.

 src/photos-base-manager.c |   16 ++++++++++++----
 src/photos-base-manager.h |    1 +
 2 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/src/photos-base-manager.c b/src/photos-base-manager.c
index fdfc6fc..5987489 100644
--- a/src/photos-base-manager.c
+++ b/src/photos-base-manager.c
@@ -115,6 +115,16 @@ photos_base_manager_default_get_object_by_id (PhotosBaseManager *self, const gch
 }
 
 
+static GHashTable *
+photos_base_manager_default_get_objects (PhotosBaseManager *self)
+{
+  PhotosBaseManagerPrivate *priv;
+
+  priv = photos_base_manager_get_instance_private (self);
+  return priv->objects;
+}
+
+
 static gchar *
 photos_base_manager_default_get_where (PhotosBaseManager *self, gint flags)
 {
@@ -238,6 +248,7 @@ photos_base_manager_class_init (PhotosBaseManagerClass *class)
   class->get_active_object = photos_base_manager_default_get_active_object;
   class->get_filter = photos_base_manager_default_get_filter;
   class->get_object_by_id = photos_base_manager_default_get_object_by_id;
+  class->get_objects = photos_base_manager_default_get_objects;
   class->get_where = photos_base_manager_default_get_where;
   class->remove_object_by_id = photos_base_manager_default_remove_object_by_id;
   class->set_active_object = photos_base_manager_default_set_active_object;
@@ -413,10 +424,7 @@ photos_base_manager_get_object_by_id (PhotosBaseManager *self, const gchar *id)
 GHashTable *
 photos_base_manager_get_objects (PhotosBaseManager *self)
 {
-  PhotosBaseManagerPrivate *priv;
-
-  priv = photos_base_manager_get_instance_private (self);
-  return priv->objects;
+  return PHOTOS_BASE_MANAGER_GET_CLASS (self)->get_objects (self);
 }
 
 
diff --git a/src/photos-base-manager.h b/src/photos-base-manager.h
index 030d24d..e1b8bd2 100644
--- a/src/photos-base-manager.h
+++ b/src/photos-base-manager.h
@@ -69,6 +69,7 @@ struct _PhotosBaseManagerClass
   GObject *(*get_active_object) (PhotosBaseManager *self);
   gchar *(*get_filter)    (PhotosBaseManager *self, gint flags);
   GObject *(*get_object_by_id) (PhotosBaseManager *self, const gchar *id);
+  GHashTable *(*get_objects) (PhotosBaseManager *self);
   gchar *(*get_where)    (PhotosBaseManager *self, gint flags);
   void (*remove_object_by_id) (PhotosBaseManager *self, const gchar *id);
   gboolean (*set_active_object)    (PhotosBaseManager *self, GObject *object);


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