[gnome-photos/wip/rishi/manager-model: 1/6] base-manager: Stop using photos_base_manager_get_objects



commit 2333a02abaf44cd48721102c4368bec4718aa11d
Author: Debarshi Ray <debarshir gnome org>
Date:   Sat Nov 5 17:07:25 2016 +0100

    base-manager: Stop using photos_base_manager_get_objects
    
    The photos_base_manager_get_objects method is headed for removal. It is
    not a good idea to publicly expose the BaseManager's GHashTable. Once
    we implement the GListModel interface, the GHashTable will have a lot
    more internal data and won't be a simple map from ID to GObject.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774191

 src/photos-base-manager.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/photos-base-manager.c b/src/photos-base-manager.c
index d92bdfa..08220b3 100644
--- a/src/photos-base-manager.c
+++ b/src/photos-base-manager.c
@@ -479,16 +479,16 @@ photos_base_manager_get_where (PhotosBaseManager *self, gint flags)
 void
 photos_base_manager_process_new_objects (PhotosBaseManager *self, GHashTable *new_objects)
 {
-  GHashTable *old_objects;
+  PhotosBaseManagerPrivate *priv;
   GHashTableIter iter;
   GObject *object;
   const gchar *id;
 
   g_return_if_fail (PHOTOS_IS_BASE_MANAGER (self));
 
-  old_objects = photos_base_manager_get_objects (self);
+  priv = photos_base_manager_get_instance_private (self);
 
-  g_hash_table_iter_init (&iter, old_objects);
+  g_hash_table_iter_init (&iter, priv->objects);
   while (g_hash_table_iter_next (&iter, (gpointer *) &id, (gpointer *) &object))
     {
       gboolean builtin;
@@ -512,7 +512,7 @@ photos_base_manager_process_new_objects (PhotosBaseManager *self, GHashTable *ne
       /* If new items are not found in the older hash table, add
        * them.
        */
-      if (g_hash_table_lookup (old_objects, id) == NULL)
+      if (g_hash_table_lookup (priv->objects, id) == NULL)
         photos_base_manager_add_object (self, object);
     }
 


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