summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBradford Hovinen <hovinen@ximian.com>2001-09-28 21:04:53 +0000
committerBradford Hovinen (Gdict maintainer) <hovinen@src.gnome.org>2001-09-28 21:04:53 +0000
commit233eec9ccaf4620e3cc19e38e2f2fac6acd9cd07 (patch)
tree5144f12d34b6e8f470baaaf08f17fff0f34e85fe
parentca6b2c78e6e08bbe4942ff2b8b4a7175ccd94bbb (diff)
downloadgnome-control-center-233eec9ccaf4620e3cc19e38e2f2fac6acd9cd07.tar.gz
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
-rw-r--r--archiver/ChangeLog3
-rw-r--r--archiver/bonobo-config-archiver.c10
-rw-r--r--archiver/bonobo-config-archiver.h1
3 files changed, 14 insertions, 0 deletions
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 <hovinen@ximian.com>
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 {