GNOME Bugzilla – Bug 88828
XML backend should use the same cache for multiple sources with the same root directory
Last modified: 2004-12-22 21:47:04 UTC
Subject says it all really ... I'll attach a patch
Created attachment 10011 [details] [review] xml backend using same cache for multiple sources with same root directory
This looks fine to apply, if you still care. (Seeing several of your patches in here from a long time ago makes me feel a bit guilty...)
Heh, its the other patch I care more about :-) I'll commit this, but do you want it just on HEAD or on gnome-2-2 as well? Also, I haven't looked at the markup backend but it would probably need a similar patch right ?
I'd say head only, this is just an optimization not a bugfix, and it might break something. It does appear markup backend needs the same fix.
To be honest, I've forgotten the details. But it definetly wasn't just an optimisation. I think it was that the cache's get out of sync if you are editing two different composite databases.
OK. I think it's safe to say composite (or non-default) databases don't work at all on stable branch, in fact I think gconf prints a warning if you create one, or used to. The larger patch for composite databases seems pretty clearly like it's a HEAD-only patch.
2003-03-14 Mark McLoughlin <mark@skynet.ie> Basically the same patch as the previous one .. but for the markup backend. * backends/markup-backend.c: (resolve_address): update. (clear_cache): use markup_tree_rebuild() instead of re-creating the tree. (ms_new): remove the read_only arg and s/markup_tree_new/ markup_tree_get/ (ms_destroy): s/markup_tree_free/markup_tree_unref/ * backends/markup-tree.[ch]: (markup_tree_get), (markup_tree_unref): rename these from new()/free() and share caches for sources with the same root directory. (markup_tree_rebuild): impl. (markup_dir_needs_sync): we don't keep the read_only flag per-tree anymore so don't check it here. 2002-07-16 Mark McLoughlin <mark@skynet.ie> Use the same cache for multiple sources with the same root directory. * backends/xml-cache.[ch]: (cache_get): rename from cache_new and return and existing cache for this root dir if one exists. Also use g_free as a key destroy handler for the nonexistant hash instead of doing it manually. (cache_unref): rename from cache_destroy and only destroy when refcount drops to zero. (cache_set_nonexistent), (cache_destroy_nonexistant_foreach): don't free the key here. * backends/xml-backend.c: (xs_new): s/cache_new/cache_get/ (xs_destroy): s/cache_destroy/cache_unref/.