1 diff -urN GConf-2.26.1/gconf/gconf-client.c GConf-2.26.1.new/gconf/gconf-client.c
2 --- GConf-2.26.1/gconf/gconf-client.c 2009-05-06 02:37:32.000000000 +0200
3 +++ GConf-2.26.1.new/gconf/gconf-client.c 2009-05-09 12:20:23.420739141 +0200
5 client->error_mode = GCONF_CLIENT_HANDLE_UNRETURNED;
6 client->dir_hash = g_hash_table_new (g_str_hash, g_str_equal);
7 client->cache_hash = g_hash_table_new (g_str_hash, g_str_equal);
8 - client->cache_dirs = g_hash_table_new_full (g_str_hash, g_str_equal,
10 /* We create the listeners only if they're actually used */
11 client->listeners = NULL;
12 client->notify_list = NULL;
14 g_hash_table_destroy (client->cache_hash);
15 client->cache_hash = NULL;
17 - g_hash_table_destroy (client->cache_dirs);
18 - client->cache_dirs = NULL;
20 unregister_client (client);
22 set_engine (client, NULL);
28 -clear_cache_dirs_foreach (char *key, gpointer value, char *dir)
30 - if (strcmp (dir, key) == 0 ||
31 - gconf_key_is_below (dir, key))
33 - trace ("'%s' no longer fully cached", dir);
41 gconf_client_real_remove_dir (GConfClient* client,
44 g_hash_table_foreach_remove (client->cache_hash,
45 (GHRFunc)clear_dir_cache_foreach,
47 - g_hash_table_foreach_remove (client->cache_dirs,
48 - (GHRFunc)clear_cache_dirs_foreach,
54 g_hash_table_foreach_remove (client->cache_hash, (GHRFunc)clear_cache_foreach,
57 - g_hash_table_remove_all (client->cache_dirs);
58 + g_assert (g_hash_table_size(client->cache_hash) == 0);
65 cache_entry_list_destructively (client, pairs);
66 - trace ("Mark '%s' as fully cached", dir);
67 - g_hash_table_insert (client->cache_dirs, g_strdup (dir), GINT_TO_POINTER (1));
71 @@ -1085,28 +1062,13 @@
77 - if (g_hash_table_lookup (client->cache_dirs, dir))
79 - GHashTableIter iter;
83 - trace ("CACHED: Getting all values in '%s'", dir);
85 - dirlen = strlen (dir);
87 - g_hash_table_iter_init (&iter, client->cache_hash);
88 - while (g_hash_table_iter_next (&iter, &key, &entry))
90 - if (g_str_has_prefix (key, dir) &&
91 - key + dirlen == strrchr (key, '/'))
92 - retval = g_slist_prepend (retval, gconf_entry_copy (entry));
98 + /* We could just use the cache to get all the entries,
99 + * iff we have previously done an all_entries and the
100 + * cache hasn't since been tossed out, and if we are monitoring
105 trace ("REMOTE: Getting all values in '%s'", dir);
107 @@ -1120,11 +1082,7 @@
110 if (key_being_monitored (client, dir))
112 - cache_entry_list_destructively (client, copy_entry_list (retval));
113 - trace ("Mark '%s' as fully cached", dir);
114 - g_hash_table_insert (client->cache_dirs, g_strdup (dir), GINT_TO_POINTER (1));
116 + cache_entry_list_destructively (client, copy_entry_list (retval));
120 @@ -1260,8 +1218,7 @@
122 trace ("CACHED: Query for '%s'", key);
126 + g_assert (entry != NULL);
128 if (gconf_entry_get_is_default (entry) && !use_default)
130 @@ -2009,25 +1966,6 @@
136 - char *dir, *last_slash;
138 - dir = g_strdup (key);
139 - last_slash = strrchr (dir, '/');
140 - g_assert (last_slash != NULL);
143 - if (g_hash_table_lookup (client->cache_dirs, dir))
146 - trace ("Negative cache hit on %s", key);
153 return entry != NULL;
156 diff -urN GConf-2.26.1/gconf/gconf-client.h GConf-2.26.1.new/gconf/gconf-client.h
157 --- GConf-2.26.1/gconf/gconf-client.h 2009-04-25 08:44:06.000000000 +0200
158 +++ GConf-2.26.1.new/gconf/gconf-client.h 2009-05-09 12:20:54.943919396 +0200
161 guint notify_handler;
162 int pending_notify_count;
163 - GHashTable *cache_dirs;