From 10e8b799a705ce1dc0c8c30b44a56247c176ac26 Mon Sep 17 00:00:00 2001 From: Bradford Hovinen Date: Thu, 12 Jul 2001 19:15:36 +0000 Subject: [PATCH] Only try to store a full snapshot if we are in a global archive 2001-07-12 Bradford Hovinen * archive.c (archive_get_current_location_id): Only try to store a full snapshot if we are in a global archive * bonobo-config-archiver.c (bonobo_config_archiver_new): Store real_name in archiver_db (bonobo_config_archiver_destroy): Use archiver_db->real_name with bonobo_url_register --- archiver/ChangeLog | 10 ++++++++++ archiver/archive.c | 4 +++- archiver/bonobo-config-archiver.c | 11 +++++++---- archiver/bonobo-config-archiver.h | 1 + 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/archiver/ChangeLog b/archiver/ChangeLog index d199cbd56..e86fb953b 100644 --- a/archiver/ChangeLog +++ b/archiver/ChangeLog @@ -1,3 +1,13 @@ +2001-07-12 Bradford Hovinen + + * archive.c (archive_get_current_location_id): Only try to store a + full snapshot if we are in a global archive + + * bonobo-config-archiver.c (bonobo_config_archiver_new): Store + real_name in archiver_db + (bonobo_config_archiver_destroy): Use archiver_db->real_name with + bonobo_url_register + 2001-07-10 Bradford Hovinen * default-user.xml: Add sound-properties diff --git a/archiver/archive.c b/archiver/archive.c index 334673337..2dde9af7f 100644 --- a/archiver/archive.c +++ b/archiver/archive.c @@ -522,7 +522,9 @@ archive_get_current_location_id (Archive *archive) (location_new (archive, archive->current_location_id, NULL)); - if (location_store_full_snapshot (loc) < 0) { + if (!archive->is_global || + location_store_full_snapshot (loc) < 0) + { location_delete (loc); return NULL; } diff --git a/archiver/bonobo-config-archiver.c b/archiver/bonobo-config-archiver.c index 556a058bc..f5b1aa0ce 100644 --- a/archiver/bonobo-config-archiver.c +++ b/archiver/bonobo-config-archiver.c @@ -482,12 +482,15 @@ static void bonobo_config_archiver_destroy (GtkObject *object) { BonoboConfigArchiver *archiver_db = BONOBO_CONFIG_ARCHIVER (object); - CORBA_Environment ev; + CORBA_Environment ev; CORBA_exception_init (&ev); - bonobo_url_unregister ("BONOBO_CONF:ARCHIVER", archiver_db->filename, &ev); - + if (archiver_db->real_name != NULL) { + bonobo_url_unregister ("BONOBO_CONF:ARCHIVER", archiver_db->real_name, &ev); + g_free (archiver_db->real_name); + } + CORBA_exception_free (&ev); if (archiver_db->doc) @@ -655,6 +658,7 @@ bonobo_config_archiver_new (const char *backend_id, const char *location_id) archiver_db->backend_id = g_strdup (backend_id); archiver_db->archive = archive; + archiver_db->real_name = real_name; archiver_db->doc = location_load_rollback_data (archiver_db->location, NULL, 0, archiver_db->backend_id, TRUE); @@ -693,7 +697,6 @@ bonobo_config_archiver_new (const char *backend_id, const char *location_id) db = CORBA_Object_duplicate (BONOBO_OBJREF (archiver_db), NULL); bonobo_url_register ("BONOBO_CONF:ARCHIVER", real_name, NULL, db, &ev); - g_free (real_name); return db; } diff --git a/archiver/bonobo-config-archiver.h b/archiver/bonobo-config-archiver.h index 68733892f..6ceddee9c 100644 --- a/archiver/bonobo-config-archiver.h +++ b/archiver/bonobo-config-archiver.h @@ -59,6 +59,7 @@ struct _BonoboConfigArchiver { Archive *archive; Location *location; gchar *backend_id; + gchar *real_name; BonoboEventSource *es; };