Store the listener id in the archiver_db structure

2001-09-28  Bradford Hovinen  <hovinen@ximian.com>

	* 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
This commit is contained in:
Bradford Hovinen 2001-09-28 21:04:53 +00:00 committed by Bradford Hovinen (Gdict maintainer)
parent ca6b2c78e6
commit 233eec9cca
3 changed files with 14 additions and 0 deletions

View file

@ -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 <hovinen@ximian.com>

View file

@ -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);

View file

@ -67,6 +67,7 @@ struct _BonoboConfigArchiver {
BonoboPropertyBag *pb;
Bonobo_EventSource_ListenerId listener_id;
gboolean is_up_to_date;
};
typedef struct {