[gimp] Rename cache utility function and reorder stuff to make more sense



commit a0e70231fbe8e7f38650498991ed55c86142ecce
Author: Michael Natterer <mitch gimp org>
Date:   Fri Oct 30 22:40:50 2009 +0100

    Rename cache utility function and reorder stuff to make more sense

 app/core/gimpdatafactory.c |   46 ++++++++++++++++++++++----------------------
 1 files changed, 23 insertions(+), 23 deletions(-)
---
diff --git a/app/core/gimpdatafactory.c b/app/core/gimpdatafactory.c
index 71cfcff..9340896 100644
--- a/app/core/gimpdatafactory.c
+++ b/app/core/gimpdatafactory.c
@@ -239,11 +239,23 @@ gimp_data_factory_data_init (GimpDataFactory *factory,
   gimp_container_thaw (factory->priv->container);
 }
 
-typedef struct
+static void
+gimp_data_factory_refresh_cache_add (GimpDataFactory *factory,
+                                     GimpData        *data,
+                                     gpointer         user_data)
 {
-  GimpDataFactory *factory;
-  GHashTable      *cache;
-} GimpDataLoadContext;
+  GHashTable *cache = user_data;
+  GList      *list;
+
+  g_object_ref (data);
+
+  gimp_container_remove (factory->priv->container, GIMP_OBJECT (data));
+
+  list = g_hash_table_lookup (cache, data->filename);
+  list = g_list_prepend (list, data);
+
+  g_hash_table_insert (cache, (gpointer) data->filename, list);
+}
 
 static gboolean
 gimp_data_factory_refresh_cache_remove (gpointer key,
@@ -261,24 +273,6 @@ gimp_data_factory_refresh_cache_remove (gpointer key,
 }
 
 static void
-gimp_data_factory_data_move_to_cache (GimpDataFactory *factory,
-                                      GimpData        *data,
-                                      gpointer         user_data)
-{
-  GHashTable *cache = user_data;
-  GList      *list;
-
-  g_object_ref (data);
-
-  gimp_container_remove (factory->priv->container, GIMP_OBJECT (data));
-
-  list = g_hash_table_lookup (cache, data->filename);
-  list = g_list_prepend (list, data);
-
-  g_hash_table_insert (cache, (gpointer) data->filename, list);
-}
-
-static void
 gimp_data_factory_data_foreach (GimpDataFactory     *factory,
                                 GimpDataForeachFunc  callback,
                                 gpointer             user_data)
@@ -316,6 +310,12 @@ gimp_data_factory_data_foreach (GimpDataFactory     *factory,
     }
 }
 
+typedef struct
+{
+  GimpDataFactory *factory;
+  GHashTable      *cache;
+} GimpDataLoadContext;
+
 static void
 gimp_data_factory_data_load (GimpDataFactory *factory,
                              GHashTable      *cache)
@@ -386,7 +386,7 @@ gimp_data_factory_data_refresh (GimpDataFactory *factory)
   cache = g_hash_table_new (g_str_hash, g_str_equal);
 
   gimp_data_factory_data_foreach (factory,
-                                  gimp_data_factory_data_move_to_cache, cache);
+                                  gimp_data_factory_refresh_cache_add, cache);
 
   /*  Now the cache contains a filename => list-of-objects mapping of
    *  the old objects. So we should now traverse the directory and for



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