diff options
author | Nick Schermer <nick@xfce.org> | 2010-02-10 12:17:28 +0100 |
---|---|---|
committer | Nick Schermer <nick@xfce.org> | 2010-02-10 12:17:28 +0100 |
commit | 4705ae3b1628a0202862cf1d0a5b7119376f1db2 (patch) | |
tree | c8982e530d59341fb59054e10c63751e7e868fe2 /xfconf/xfconf-cache.c | |
parent | 167c0162acf12463b420c9e6451ec56725d602a5 (diff) | |
download | xfconf-4705ae3b1628a0202862cf1d0a5b7119376f1db2.tar.gz |
Don't look for existing keys during prefetch.
Since each channel has its own cache, we can avoid updating
values because the hash table contains unique properties and
there are no nodes in the tree yet.
Diffstat (limited to 'xfconf/xfconf-cache.c')
-rw-r--r-- | xfconf/xfconf-cache.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/xfconf/xfconf-cache.c b/xfconf/xfconf-cache.c index 95c09da..baefcfd 100644 --- a/xfconf/xfconf-cache.c +++ b/xfconf/xfconf-cache.c @@ -599,20 +599,13 @@ xfconf_cache_prefetch_ht(gpointer key, gpointer value, gpointer user_data) { - gchar *property = key; - GValue *val = value; XfconfCache *cache = XFCONF_CACHE(user_data); XfconfCacheItem *item; - item = g_tree_lookup(cache->properties, property); - if(item) { - xfconf_cache_item_update(item, val); - return FALSE; - } else { - item = xfconf_cache_item_new(val, TRUE); - g_tree_insert(cache->properties, property, item); - return TRUE; - } + item = xfconf_cache_item_new(value, TRUE); + g_tree_insert(cache->properties, key, item); + + return TRUE; } gboolean @@ -625,6 +618,8 @@ xfconf_cache_prefetch(XfconfCache *cache, DBusGProxy *proxy = _xfconf_get_dbus_g_proxy(); GError *tmp_error = NULL; + g_return_val_if_fail(g_tree_nnodes(cache->properties) == 0, FALSE); + xfconf_cache_mutex_lock(&cache->cache_lock); if(xfconf_client_get_all_properties(proxy, cache->channel_name, |