Commit 77e889f0 authored by Havoc Pennington's avatar Havoc Pennington
Browse files

anoher xml backend fix

parent 0a264503
......@@ -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)
{
......
......@@ -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);
......
......@@ -146,7 +146,7 @@ sync_and_clear (GConfSource *source)
exit (1);
}
(* source->backend->vtable->clear_cache) (source);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment