[gnome-photos] base-manager: Make get_objects a virtual method



commit 37eaf35d7e34d956dd9b9c8379c21b1a285a3047
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.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=770157

 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 f5da1e2..c0f4e22 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]