[glib/wip/gdesktopappinfo: 7/13] gdesktopappinfo: remove global_defaults_cache



commit a9a8547580a78bb80e509e7291b5af13fe6b088e
Author: Ryan Lortie <desrt desrt ca>
Date:   Wed Jul 24 17:28:43 2013 -0400

    gdesktopappinfo: remove global_defaults_cache
    
    ...and some related functions.
    
    This variable is also used for nothing at all.

 gio/gdesktopappinfo.c |   28 +++-------------------------
 1 files changed, 3 insertions(+), 25 deletions(-)
---
diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c
index 0df6ffc..3080750 100644
--- a/gio/gdesktopappinfo.c
+++ b/gio/gdesktopappinfo.c
@@ -2837,7 +2837,6 @@ typedef struct {
 
 typedef struct {
   GList *dirs;                       /* mimeinfo.cache and defaults.list */
-  GHashTable *global_defaults_cache; /* global results of defaults.list lookup and validation */
   time_t last_stat_time;
 } MimeInfoCache;
 
@@ -2889,22 +2888,6 @@ mime_info_cache_dir_out_of_date (MimeInfoCacheDir *dir,
 }
 
 /* Call with lock held */
-static gboolean
-remove_all (gpointer  key,
-           gpointer  value,
-           gpointer  user_data)
-{
-  return TRUE;
-}
-
-
-static void
-mime_info_cache_blow_global_cache (void)
-{
-  g_hash_table_foreach_remove (mime_info_cache->global_defaults_cache,
-                              remove_all, NULL);
-}
-
 static void
 mime_info_cache_dir_init (MimeInfoCacheDir *dir)
 {
@@ -3309,7 +3292,6 @@ mime_info_cache_update_dir_lists (void)
       MimeInfoCacheDir *dir = (MimeInfoCacheDir *) tmp->data;
 
       /* No need to do this if we had file monitors... */
-      mime_info_cache_blow_global_cache ();
       mime_info_cache_dir_init (dir);
       mime_info_cache_dir_init_defaults_list (dir);
       mime_info_cache_dir_init_mimeapps_list (dir);
@@ -3343,12 +3325,9 @@ static MimeInfoCache *
 mime_info_cache_new (void)
 {
   MimeInfoCache *cache;
-  
+
   cache = g_new0 (MimeInfoCache, 1);
-  
-  cache->global_defaults_cache = g_hash_table_new_full (g_str_hash, g_str_equal,
-                                                       (GDestroyNotify) g_free,
-                                                       (GDestroyNotify) g_free);
+
   return cache;
 }
 
@@ -3357,9 +3336,8 @@ mime_info_cache_free (MimeInfoCache *cache)
 {
   if (cache == NULL)
     return;
-  
+
   g_list_free_full (cache->dirs, (GDestroyNotify) mime_info_cache_dir_free);
-  g_hash_table_destroy (cache->global_defaults_cache);
   g_free (cache);
 }
 


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