From 2c2fafbaad56331a77ca588a520a9e6ff7b6afff Mon Sep 17 00:00:00 2001 From: Bradford Hovinen Date: Mon, 9 Jul 2001 19:56:27 +0000 Subject: [PATCH] Use bonobo_object_unref rather than gtk_object_destroy 2001-07-09 Bradford Hovinen * bonobo-config-archiver.c (bonobo_config_archiver_new): Use bonobo_object_unref rather than gtk_object_destroy * bonobo-moniker-archiver.c (archiver_resolve): Allow PropertyBag interface as well (parse_name): Set *location to NULL when there is no location * sound-properties.xml: Use 0 and 1 rather than true and false * capplet-dir.c (capplet_control_launch): Don't convert underscores to dashes in moniker --- archiver/ChangeLog | 8 ++++++++ archiver/archive.c | 2 +- archiver/bonobo-config-archiver.c | 4 ++-- archiver/bonobo-moniker-archiver.c | 9 +++++---- capplets/sound/ChangeLog | 2 ++ capplets/sound/sound-properties.xml | 4 ++-- control-center/ChangeLog | 2 ++ control-center/capplet-dir.c | 10 +++++----- 8 files changed, 27 insertions(+), 14 deletions(-) diff --git a/archiver/ChangeLog b/archiver/ChangeLog index e2255b45d..f69febd89 100644 --- a/archiver/ChangeLog +++ b/archiver/ChangeLog @@ -1,7 +1,15 @@ 2001-07-09 Bradford Hovinen + * bonobo-config-archiver.c (bonobo_config_archiver_new): Use + bonobo_object_unref rather than gtk_object_destroy + + * bonobo-moniker-archiver.c (archiver_resolve): Allow PropertyBag + interface as well + (parse_name): Set *location to NULL when there is no location + * archive.c (archive_load): Use .gnome/capplet-archive rather than .gnome/control-center + (archive_set_current_location): Removed unused variables * bonobo-config-archiver.c (bonobo_config_archiver_new): Try to load the defaults file if no rollback data can be found diff --git a/archiver/archive.c b/archiver/archive.c index 14024754d..334673337 100644 --- a/archiver/archive.c +++ b/archiver/archive.c @@ -437,7 +437,7 @@ archive_get_current_location (Archive *archive) void archive_set_current_location (Archive *archive, Location *location) { - GList *backends1, *backends2, *backends, *tmp; + GList *backends; Location *old_location = archive_get_current_location (archive); g_return_if_fail (archive != NULL); diff --git a/archiver/bonobo-config-archiver.c b/archiver/bonobo-config-archiver.c index 9be974fab..0baac12a3 100644 --- a/archiver/bonobo-config-archiver.c +++ b/archiver/bonobo-config-archiver.c @@ -646,7 +646,7 @@ bonobo_config_archiver_new (const char *backend_id, const char *location_id) archiver_db->location = archive_get_location (archive, location_id); if (archiver_db->location == NULL) { - gtk_object_destroy (GTK_OBJECT (archiver_db)); + bonobo_object_unref (BONOBO_OBJECT (archiver_db)); return CORBA_OBJECT_NIL; } @@ -664,7 +664,7 @@ bonobo_config_archiver_new (const char *backend_id, const char *location_id) g_free (filename); if (archiver_db->doc == NULL) { - gtk_object_destroy (GTK_OBJECT (archiver_db)); + bonobo_object_unref (BONOBO_OBJECT (archiver_db)); return CORBA_OBJECT_NIL; } } diff --git a/archiver/bonobo-moniker-archiver.c b/archiver/bonobo-moniker-archiver.c index d40d07c55..1957e1e5d 100644 --- a/archiver/bonobo-moniker-archiver.c +++ b/archiver/bonobo-moniker-archiver.c @@ -46,6 +46,7 @@ parse_name (const gchar *name, gchar **backend_id, gchar **location) *backend_id = g_strdup (e + 1); } else { *backend_id = g_strdup (name); + *location = NULL; } return TRUE; @@ -62,7 +63,9 @@ archiver_resolve (BonoboMoniker *moniker, const gchar *name; gchar *backend_id, *location; - if (strcmp (requested_interface, "IDL:Bonobo/ConfigDatabase:1.0")) { + if (strcmp (requested_interface, "IDL:Bonobo/ConfigDatabase:1.0") && + strcmp (requested_interface, "IDL:Bonobo/PropertyBag:1.0")) + { EX_SET_NOT_FOUND (ev); return CORBA_OBJECT_NIL; } @@ -75,10 +78,8 @@ archiver_resolve (BonoboMoniker *moniker, if (parent != CORBA_OBJECT_NIL) { - pdb = Bonobo_Moniker_resolve (parent, options, - "IDL:Bonobo/ConfigDatabase:1.0", - ev); + requested_interface, ev); bonobo_object_release_unref (parent, NULL); diff --git a/capplets/sound/ChangeLog b/capplets/sound/ChangeLog index 70ff4a5b9..da1c69066 100644 --- a/capplets/sound/ChangeLog +++ b/capplets/sound/ChangeLog @@ -1,5 +1,7 @@ 2001-07-09 Bradford Hovinen + * sound-properties.xml: Use 0 and 1 rather than true and false + * sound-properties-capplet.c (create_control_cb): Implement (main): Use create_control_cb diff --git a/capplets/sound/sound-properties.xml b/capplets/sound/sound-properties.xml index d14e23383..67b8bcbf9 100644 --- a/capplets/sound/sound-properties.xml +++ b/capplets/sound/sound-properties.xml @@ -1,7 +1,7 @@
- - + +
diff --git a/control-center/ChangeLog b/control-center/ChangeLog index eefd9cc7f..70be108ee 100644 --- a/control-center/ChangeLog +++ b/control-center/ChangeLog @@ -8,6 +8,8 @@ (capplet_ok_cb): Ditto. (capplet_control_launch): Don't use a BonoboArg when setting the property + (capplet_control_launch): Don't convert underscores to dashes in + moniker * Makefile.am (INCLUDES): Update directory locations diff --git a/control-center/capplet-dir.c b/control-center/capplet-dir.c index 6d55bbd9d..2a5a8b940 100644 --- a/control-center/capplet-dir.c +++ b/control-center/capplet-dir.c @@ -417,16 +417,17 @@ capplet_control_launch (const gchar *capplet_name) tmp = g_strdup (capplet_name); if ((tmp1 = strstr (tmp, "-capplet")) != NULL) *tmp1 = '\0'; + moniker = g_strconcat ("archiver:", tmp, NULL); while ((tmp1 = strchr (tmp, '-'))) *tmp1 = '_'; oaf_iid = g_strconcat ("OAFIID:Bonobo_Control_Capplet_", tmp, NULL); + g_free (tmp); property_control = bonobo_get_object (oaf_iid, "IDL:Bonobo/PropertyControl:1.0", &ev); g_free (oaf_iid); if (BONOBO_EX (&ev) || property_control == CORBA_OBJECT_NIL) { g_critical ("Could not resolve PropertyControl"); - g_free (tmp); return NULL; } @@ -435,7 +436,7 @@ capplet_control_launch (const gchar *capplet_name) if (BONOBO_EX (&ev) || property_control == CORBA_OBJECT_NIL) { g_critical ("Could not extract control from PropertyControl"); bonobo_object_release_unref (property_control, &ev); - g_free (tmp); + g_free (moniker); return NULL; } @@ -447,13 +448,12 @@ capplet_control_launch (const gchar *capplet_name) if (control == NULL) { g_critical ("Could not create widget from control"); gtk_widget_destroy (app); + g_free (moniker); app = NULL; } else { gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (app)->vbox), control, TRUE, TRUE, 0); - moniker = g_strconcat ("archiver:", tmp, NULL); bonobo_widget_set_property (BONOBO_WIDGET (control), "moniker", moniker, NULL); - g_free (moniker); gtk_widget_show_all (app); } @@ -462,7 +462,7 @@ capplet_control_launch (const gchar *capplet_name) gnome_dialog_button_connect (GNOME_DIALOG (app), 1, GTK_SIGNAL_FUNC (capplet_cancel_cb), app); CORBA_exception_free (&ev); - g_free (tmp); + g_free (moniker); return app; }