summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHavoc Pennington <hp@src.gnome.org>2002-06-02 05:49:40 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-06-02 05:49:40 +0000
commit77e889f0e57fd1dd8ee45262b4e09c22b6773ad7 (patch)
tree0819ef859b8f4ba2de762f887c3a4dcde37bcccb
parent0a26450327976f2d85f82c79d2d2ec3b68dd4d1e (diff)
downloadgconf-markup-hacking.tar.gz
anoher xml backend fixgconf-markup-hacking
-rw-r--r--backends/xml-cache.c16
-rw-r--r--gconf/gconf-backend.c7
-rw-r--r--tests/testbackend.c2
3 files changed, 22 insertions, 3 deletions
diff --git a/backends/xml-cache.c b/backends/xml-cache.c
index 3b158d96..56b9c3bb 100644
--- a/backends/xml-cache.c
+++ b/backends/xml-cache.c
@@ -113,6 +113,7 @@ typedef struct _SyncData SyncData;
struct _SyncData {
gboolean failed;
Cache* dc;
+ gboolean deleted_some;
};
static void
@@ -155,6 +156,8 @@ cache_sync_foreach (Dir *dir,
cache_set_nonexistent (sd->dc, dir_get_name (dir),
TRUE);
dir_destroy (dir);
+
+ sd->deleted_some = TRUE;
}
}
}
@@ -216,13 +219,17 @@ gboolean
cache_sync (Cache *cache,
GError **err)
{
- SyncData sd = { FALSE, NULL };
+ SyncData sd = { FALSE, NULL, FALSE };
GSList *list;
sd.dc = cache;
gconf_log (GCL_DEBUG, "Syncing the dir cache");
+ redo:
+ sd.failed = FALSE;
+ sd.deleted_some = FALSE;
+
/* get a list of everything; we can't filter by
* whether a sync is pending since we may make parents
* of removed directories dirty when we sync their child
@@ -236,6 +243,13 @@ cache_sync (Cache *cache,
/* sync it all */
g_slist_foreach (list, (GFunc) cache_sync_foreach, &sd);
+
+ /* If we deleted some subdirs, we may now be able to delete
+ * more parent dirs. So go ahead and do the sync again.
+ * Yeah this could be more efficient.
+ */
+ if (!sd.failed && sd.deleted_some)
+ goto redo;
if (sd.failed && err && *err == NULL)
{
diff --git a/gconf/gconf-backend.c b/gconf/gconf-backend.c
index 9a98b148..97ec5ff6 100644
--- a/gconf/gconf-backend.c
+++ b/gconf/gconf-backend.c
@@ -131,8 +131,13 @@ gconf_backend_file(const gchar* address)
return NULL;
file = g_strconcat("gconfbackend-", back, NULL);
-
+
+#if 0
retval = g_module_build_path(GCONF_BACKEND_DIR, file);
+#else
+ /* don't put this in CVS! */
+ retval = "nonexistent";
+#endif
g_free(back);
diff --git a/tests/testbackend.c b/tests/testbackend.c
index e8ed4bf1..58c4ee1a 100644
--- a/tests/testbackend.c
+++ b/tests/testbackend.c
@@ -146,7 +146,7 @@ sync_and_clear (GConfSource *source)
exit (1);
}
-
+
(* source->backend->vtable->clear_cache) (source);
}