From 233eec9ccaf4620e3cc19e38e2f2fac6acd9cd07 Mon Sep 17 00:00:00 2001 From: Bradford Hovinen Date: Fri, 28 Sep 2001 21:04:53 +0000 Subject: [PATCH] Store the listener id in the archiver_db structure 2001-09-28 Bradford Hovinen * bonobo-config-archiver.c (bonobo_config_archiver_new): Store the listener id in the archiver_db structure (bonobo_config_archiver_destroy): Remove the event source listener; destroy the XML cache (new_rollback_cb): Don't reload everything if we initiated the sync ourselves (real_sync): Mark that we are currently up to date --- archiver/ChangeLog | 3 +++ archiver/bonobo-config-archiver.c | 10 ++++++++++ archiver/bonobo-config-archiver.h | 1 + 3 files changed, 14 insertions(+) diff --git a/archiver/ChangeLog b/archiver/ChangeLog index aeb78a173..cae4d91f4 100644 --- a/archiver/ChangeLog +++ b/archiver/ChangeLog @@ -4,6 +4,9 @@ listener id in the archiver_db structure (bonobo_config_archiver_destroy): Remove the event source listener; destroy the XML cache + (new_rollback_cb): Don't reload everything if we initiated the + sync ourselves + (real_sync): Mark that we are currently up to date 2001-09-22 Bradford Hovinen diff --git a/archiver/bonobo-config-archiver.c b/archiver/bonobo-config-archiver.c index ae81c5fe9..edf8ac1a4 100644 --- a/archiver/bonobo-config-archiver.c +++ b/archiver/bonobo-config-archiver.c @@ -221,6 +221,11 @@ real_sync (BonoboConfigDatabase *db, if (!db->writeable) return; + /* FIXME: This will not work correctly in the pathlogical case that two + * ConfigArchiver objects sync at almost exactly the same time. + */ + + archiver_db->is_up_to_date = TRUE; location_client_store_xml (archiver_db->location, archiver_db->backend_id, archiver_db->doc, ConfigArchiver_STORE_MASK_PREVIOUS, ev); @@ -704,6 +709,11 @@ new_rollback_cb (BonoboListener *listener, { BonoboArg *arg; + if (archiver_db->is_up_to_date) { + archiver_db->is_up_to_date = FALSE; + return; + } + if (archiver_db->dir != NULL) { delete_dir_data (archiver_db->dir, TRUE); g_free (archiver_db->dir->name); diff --git a/archiver/bonobo-config-archiver.h b/archiver/bonobo-config-archiver.h index ec25c58de..634153b72 100644 --- a/archiver/bonobo-config-archiver.h +++ b/archiver/bonobo-config-archiver.h @@ -67,6 +67,7 @@ struct _BonoboConfigArchiver { BonoboPropertyBag *pb; Bonobo_EventSource_ListenerId listener_id; + gboolean is_up_to_date; }; typedef struct {