]> git.pld-linux.org Git - packages/GConf2.git/blob - GConf2-workaround-bug581880.patch
- updated to 2.26.2
[packages/GConf2.git] / GConf2-workaround-bug581880.patch
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
4 @@ -230,8 +230,6 @@
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,
9 -                                             g_free, NULL);
10    /* We create the listeners only if they're actually used */
11    client->listeners = NULL;
12    client->notify_list = NULL;
13 @@ -309,9 +307,6 @@
14    g_hash_table_destroy (client->cache_hash);
15    client->cache_hash = NULL;
16  
17 -  g_hash_table_destroy (client->cache_dirs);
18 -  client->cache_dirs = NULL;
19 -
20    unregister_client (client);
21  
22    set_engine (client, NULL);
23 @@ -660,19 +655,6 @@
24      return FALSE;
25  }
26  
27 -static gboolean
28 -clear_cache_dirs_foreach (char *key, gpointer value, char *dir)
29 -{
30 -  if (strcmp (dir, key) == 0 ||
31 -      gconf_key_is_below (dir, key))
32 -    {
33 -      trace ("'%s' no longer fully cached", dir);
34 -      return TRUE;
35 -    }
36 -
37 -  return FALSE;
38 -}
39 -
40  static void
41  gconf_client_real_remove_dir    (GConfClient* client,
42                                   Dir* d,
43 @@ -699,9 +681,6 @@
44    g_hash_table_foreach_remove (client->cache_hash,
45                                 (GHRFunc)clear_dir_cache_foreach,
46                                 d->name);
47 -  g_hash_table_foreach_remove (client->cache_dirs,
48 -                               (GHRFunc)clear_cache_dirs_foreach,
49 -                               d->name);
50    dir_destroy(d);
51  
52    ad.client = client;
53 @@ -828,7 +807,7 @@
54    g_hash_table_foreach_remove (client->cache_hash, (GHRFunc)clear_cache_foreach,
55                                 client);
56  
57 -  g_hash_table_remove_all (client->cache_dirs);
58 +  g_assert (g_hash_table_size(client->cache_hash) == 0);
59  }
60  
61  static void
62 @@ -936,8 +915,6 @@
63      }
64  
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));
68  }
69  
70  void
71 @@ -1085,28 +1062,13 @@
72  {
73    GError *error = NULL;
74    GSList *retval;
75 -  int dirlen;
76 -
77 -  if (g_hash_table_lookup (client->cache_dirs, dir))
78 -    {
79 -      GHashTableIter iter;
80 -      gchar *key;
81 -      GConfEntry *entry;
82 -
83 -      trace ("CACHED: Getting all values in '%s'", dir);
84 -
85 -      dirlen = strlen (dir);
86 -      retval = NULL;
87 -      g_hash_table_iter_init (&iter, client->cache_hash);
88 -      while (g_hash_table_iter_next (&iter, &key, &entry))
89 -        {
90 -          if (g_str_has_prefix (key, dir) &&
91 -              key + dirlen == strrchr (key, '/'))
92 -            retval = g_slist_prepend (retval, gconf_entry_copy (entry));
93 -        }
94 -
95 -      return retval;
96 -    }
97 +  
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
101 +   * this directory.
102 +   * FIXME
103 +   */
104  
105    trace ("REMOTE: Getting all values in '%s'", dir);
106  
107 @@ -1120,11 +1082,7 @@
108      return NULL;
109  
110    if (key_being_monitored (client, dir))
111 -    {
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));
115 -    }
116 +    cache_entry_list_destructively (client, copy_entry_list (retval));
117  
118    return retval;
119  }
120 @@ -1260,8 +1218,7 @@
121      {
122        trace ("CACHED: Query for '%s'", key);
123        
124 -      if (entry == NULL)
125 -        return NULL;
126 +      g_assert (entry != NULL);
127        
128        if (gconf_entry_get_is_default (entry) && !use_default)
129          return NULL;
130 @@ -2009,25 +1966,6 @@
131  
132    *entryp = entry;
133  
134 -  if (!entry)
135 -  {
136 -    char *dir, *last_slash;
137 -
138 -    dir = g_strdup (key);
139 -    last_slash = strrchr (dir, '/');
140 -    g_assert (last_slash != NULL);
141 -    *last_slash = 0;
142 -
143 -    if (g_hash_table_lookup (client->cache_dirs, dir))
144 -    {
145 -      g_free (dir);
146 -      trace ("Negative cache hit on %s", key);
147 -      return TRUE;
148 -    }
149 -
150 -    g_free (dir);
151 -  }
152 -
153    return entry != NULL;
154  }
155  
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
159 @@ -100,7 +100,7 @@
160    GSList *notify_list;
161    guint notify_handler;
162    int pending_notify_count;
163 -  GHashTable *cache_dirs;
164 +  gpointer pad1;
165    int pad2;
166  };
167  
This page took 0.03926 seconds and 3 git commands to generate.