[patch] fix for bug #122028
Douglas Burke <[email protected]>
| Newsgroups | gmane.editors.conglomerate.devel |
|---|---|
| Message-ID | <Pine.GSO.4.58.0410151105100.14485@lagado> |
The attached patch removes the storage of an xmlAttributePtr in attribute editor and attribute wrapper objects, which should close bug #122028. I also fixed a couple of minor memory leaks in the attribute wrapper objects (string values were not being de-allocated on cleanup), removed some invalid FIXME comments (since the objects were being unreffed or freed), and removed some debugging code (ie stuff surrounded by '#if 0/#endif'). Doug
cong.diff
(text/plain, 29.8 KB)
? mkinstalldirs ? stamp-h1 Index: src/ChangeLog =================================================================== RCS file: /cvs/gnome/conglomerate/src/ChangeLog,v retrieving revision 1.735 diff -u -r1.735 ChangeLog --- src/ChangeLog 14 Oct 2004 20:54:22 -0000 1.735 +++ src/ChangeLog 15 Oct 2004 14:58:33 -0000 @@ -1,3 +1,12 @@ +2004-10-15 Douglas Burke <[email protected]> + + * cong-attribute-editor-cdata.c, cong-attribute-editor-cdata.h, cong-attribute-editor-enumeration.c, cong-attribute-editor-lang.c, cong-attribute-editor-lang.h, cong-attribute-editor-nmtoken.c, cong-attribute-editor-nmtoken.h, cong-attribute-editor.c, cong-attribute-editor.h, cong-attribute-wrapper-check-button.c, cong-attribute-wrapper-check-button.h, cong-attribute-wrapper-radio-button.c, cong-attribute-wrapper-radio-button.h, cong-attribute-wrapper.c, cong-attribute-wrapper.h, cong-glade.c: + + Fix for bug # 122028 (storage of xmlAttributePtr in the attribute + editors). Also fixes minor memory leaks in the check button and + radio button attribute wrapper objects and removal of a couple + of pieces of old debugging code. + 2004-10-14 Douglas Burke <[email protected]> * cong-plugin.c, cong-plugin.h: Index: src/cong-attribute-editor-cdata.c =================================================================== RCS file: /cvs/gnome/conglomerate/src/cong-attribute-editor-cdata.c,v retrieving revision 1.10 diff -u -r1.10 cong-attribute-editor-cdata.c --- src/cong-attribute-editor-cdata.c 23 Jun 2004 17:37:29 -0000 1.10 +++ src/cong-attribute-editor-cdata.c 15 Oct 2004 14:58:33 -0000 @@ -83,7 +83,6 @@ * @node: * @ns_ptr: * @attribute_name: - * @attr: * * TODO: Write me * Returns: @@ -93,18 +92,15 @@ CongDocument *doc, CongNodePtr node, xmlNs *ns_ptr, - const gchar *attribute_name, - xmlAttributePtr attr) + const gchar *attribute_name) { g_return_val_if_fail (IS_CONG_ATTRIBUTE_EDITOR_CDATA(attribute_editor_cdata), NULL); -#if 1 cong_attribute_editor_construct (CONG_ATTRIBUTE_EDITOR(attribute_editor_cdata), doc, node, ns_ptr, - attribute_name, - attr); + attribute_name); /* Build widgetry: */ PRIVATE(attribute_editor_cdata)->hbox = GTK_BOX(gtk_hbox_new (FALSE, 6)); @@ -112,11 +108,21 @@ PRIVATE(attribute_editor_cdata)->add_btn = GTK_BUTTON(gtk_button_new_from_stock (GTK_STOCK_ADD)); PRIVATE(attribute_editor_cdata)->delete_btn = GTK_BUTTON(gtk_button_new_from_stock (GTK_STOCK_DELETE)); - gtk_box_pack_end(PRIVATE(attribute_editor_cdata)->hbox, GTK_WIDGET(PRIVATE(attribute_editor_cdata)->delete_btn), FALSE, FALSE, 0); - gtk_box_pack_end(PRIVATE(attribute_editor_cdata)->hbox, GTK_WIDGET(PRIVATE(attribute_editor_cdata)->entry), TRUE, TRUE, 0); - - gtk_box_pack_end(PRIVATE(attribute_editor_cdata)->hbox, GTK_WIDGET(PRIVATE(attribute_editor_cdata)->add_btn), FALSE, FALSE, 0); - + gtk_box_pack_end (PRIVATE(attribute_editor_cdata)->hbox, + GTK_WIDGET(PRIVATE(attribute_editor_cdata)->delete_btn), + FALSE, + FALSE, + 0); + gtk_box_pack_end (PRIVATE(attribute_editor_cdata)->hbox, + GTK_WIDGET(PRIVATE(attribute_editor_cdata)->entry), + TRUE, + TRUE, + 0); + gtk_box_pack_end (PRIVATE(attribute_editor_cdata)->hbox, + GTK_WIDGET(PRIVATE(attribute_editor_cdata)->add_btn), + FALSE, + FALSE, + 0); gtk_container_add (GTK_CONTAINER(attribute_editor_cdata), GTK_WIDGET(PRIVATE(attribute_editor_cdata)->hbox)); @@ -136,21 +142,6 @@ "clicked", G_CALLBACK(on_delete_button), attribute_editor_cdata); -#else - { - GtkWidget *label = gtk_label_new("fubar"); - - g_assert (GTK_IS_HBOX (attribute_editor_cdata)); - - gtk_box_pack_start (GTK_BOX(attribute_editor_cdata), - label, - FALSE, - FALSE, - 0); - - gtk_widget_show (label); - } -#endif return CONG_ATTRIBUTE_EDITOR (attribute_editor_cdata); } @@ -161,7 +152,6 @@ * @node: * @ns_ptr: * @attribute_name: - * @attr: * * TODO: Write me * Returns: @@ -170,16 +160,14 @@ cong_attribute_editor_cdata_new (CongDocument *doc, CongNodePtr node, xmlNs *ns_ptr, - const gchar *attribute_name, - xmlAttributePtr attr) + const gchar *attribute_name) { return GTK_WIDGET( cong_attribute_editor_cdata_construct (g_object_new (CONG_ATTRIBUTE_EDITOR_CDATA_TYPE, NULL), doc, node, ns_ptr, - attribute_name, - attr)); + attribute_name)); } /* Internal function definitions: */ Index: src/cong-attribute-editor-cdata.h =================================================================== RCS file: /cvs/gnome/conglomerate/src/cong-attribute-editor-cdata.h,v retrieving revision 1.4 diff -u -r1.4 cong-attribute-editor-cdata.h --- src/cong-attribute-editor-cdata.h 23 Jun 2004 17:37:29 -0000 1.4 +++ src/cong-attribute-editor-cdata.h 15 Oct 2004 14:58:33 -0000 @@ -57,14 +57,13 @@ CongDocument *doc, CongNodePtr node, xmlNs *ns_ptr, - const gchar *attribute_name, - xmlAttributePtr attr); + const gchar *attribute_name); GtkWidget* cong_attribute_editor_cdata_new (CongDocument *doc, CongNodePtr node, xmlNs *ns_ptr, - const gchar *attribute_name, - xmlAttributePtr attr); + const gchar *attribute_name); + G_END_DECLS #endif Index: src/cong-attribute-editor-enumeration.c =================================================================== RCS file: /cvs/gnome/conglomerate/src/cong-attribute-editor-enumeration.c,v retrieving revision 1.16 diff -u -r1.16 cong-attribute-editor-enumeration.c --- src/cong-attribute-editor-enumeration.c 14 Oct 2004 17:49:18 -0000 1.16 +++ src/cong-attribute-editor-enumeration.c 15 Oct 2004 14:58:33 -0000 @@ -108,8 +108,7 @@ doc, node, ns_ptr, - attribute_name, - attr); + attribute_name); /* Build widgetry: */ PRIVATE(attribute_editor_enumeration)->combo_box = gtk_combo_box_new_text (); @@ -160,7 +159,7 @@ * @attr: Pointer to the attribute. * * Creates a widget that allows a user to create, edit, and delete - * the value of an attribute (@attr and @attribute) of type + * the value of an attribute (@attr) of type * XML_ATTRIBUTE_ENUMERATION. * * Returns: Index: src/cong-attribute-editor-lang.c =================================================================== RCS file: /cvs/gnome/conglomerate/src/cong-attribute-editor-lang.c,v retrieving revision 1.4 diff -u -r1.4 cong-attribute-editor-lang.c --- src/cong-attribute-editor-lang.c 23 Jun 2004 17:37:29 -0000 1.4 +++ src/cong-attribute-editor-lang.c 15 Oct 2004 14:58:33 -0000 @@ -116,17 +116,15 @@ * @doc: * @node: * @ns_ptr: - * @attr: * * TODO: Write me * Returns: */ CongAttributeEditor* cong_attribute_editor_lang_construct (CongAttributeEditorLang *attribute_editor_lang, - CongDocument *doc, - CongNodePtr node, - xmlNs *ns_ptr, - xmlAttributePtr attr) + CongDocument *doc, + CongNodePtr node, + xmlNs *ns_ptr) { CongAttributeEditorLangDetails *details; @@ -136,7 +134,6 @@ GtkTreeViewColumn *column; GtkCellRenderer *renderer; GtkTreeSelection *selection; - g_return_val_if_fail (IS_CONG_ATTRIBUTE_EDITOR_LANG(attribute_editor_lang), NULL); @@ -146,8 +143,7 @@ doc, node, ns_ptr, - "lang", - attr); + "lang"); details->model = GTK_TREE_MODEL(gtk_list_store_new (NUM_COLUMNS, G_TYPE_STRING, @@ -155,12 +151,15 @@ gtk_list_store_append (GTK_LIST_STORE(details->model), &iter); - gtk_list_store_set (GTK_LIST_STORE(details->model), &iter, - COLUMN_NAME, _("No Language"), + gtk_list_store_set (GTK_LIST_STORE(details->model), + &iter, + COLUMN_NAME, + _("No Language"), -1); for (i = 0; i < KNOWN_LANGUAGES; i++) { gtk_list_store_append (GTK_LIST_STORE(details->model), &iter); - gtk_list_store_set (GTK_LIST_STORE(details->model), &iter, + gtk_list_store_set (GTK_LIST_STORE(details->model), + &iter, COLUMN_NAME, known_languages[i].name, COLUMN_CODE, known_languages[i].code, -1); @@ -197,7 +196,6 @@ * @doc: Valid document * @node: Cong Node of attribute * @ns_ptr: Pointer to xml namespace - * @attr: Pointer to attribute * * TODO: Creates editor of language-based attribute * Returns: @@ -205,15 +203,13 @@ GtkWidget* cong_attribute_editor_lang_new (CongDocument *doc, CongNodePtr node, - xmlNs *ns_ptr, - xmlAttributePtr attr) + xmlNs *ns_ptr) { return GTK_WIDGET( cong_attribute_editor_lang_construct (g_object_new (CONG_ATTRIBUTE_EDITOR_LANG_TYPE, NULL), doc, node, - ns_ptr, - attr)); + ns_ptr)); } /* Internal function definitions: */ Index: src/cong-attribute-editor-lang.h =================================================================== RCS file: /cvs/gnome/conglomerate/src/cong-attribute-editor-lang.h,v retrieving revision 1.2 diff -u -r1.2 cong-attribute-editor-lang.h --- src/cong-attribute-editor-lang.h 23 Jun 2004 17:37:29 -0000 1.2 +++ src/cong-attribute-editor-lang.h 15 Oct 2004 14:58:33 -0000 @@ -55,15 +55,13 @@ CongAttributeEditor* cong_attribute_editor_lang_construct (CongAttributeEditorLang *attribute_editor_lang, - CongDocument *doc, - CongNodePtr node, - xmlNs *ns_ptr, - xmlAttributePtr attr); + CongDocument *doc, + CongNodePtr node, + xmlNs *ns_ptr); GtkWidget* cong_attribute_editor_lang_new (CongDocument *doc, CongNodePtr node, - xmlNs *ns_ptr, - xmlAttributePtr attr); + xmlNs *ns_ptr); G_END_DECLS #endif Index: src/cong-attribute-editor-nmtoken.c =================================================================== RCS file: /cvs/gnome/conglomerate/src/cong-attribute-editor-nmtoken.c,v retrieving revision 1.1 diff -u -r1.1 cong-attribute-editor-nmtoken.c --- src/cong-attribute-editor-nmtoken.c 31 Aug 2004 01:13:50 -0000 1.1 +++ src/cong-attribute-editor-nmtoken.c 15 Oct 2004 14:58:33 -0000 @@ -86,7 +86,6 @@ * @node: * @ns_ptr: * @attribute_name: - * @attr: * * Constructror called by #cong_attribute_editor_nmtoken_new() * @@ -97,8 +96,7 @@ CongDocument *doc, CongNodePtr node, xmlNs *ns_ptr, - const gchar *attribute_name, - xmlAttributePtr attr) + const gchar *attribute_name) { g_return_val_if_fail (IS_CONG_ATTRIBUTE_EDITOR_NMTOKEN(attribute_editor_nmtoken), NULL); @@ -106,8 +104,7 @@ doc, node, ns_ptr, - attribute_name, - attr); + attribute_name); /* Build widgetry: */ PRIVATE(attribute_editor_nmtoken)->hbox = GTK_BOX(gtk_hbox_new (FALSE, 6)); @@ -149,7 +146,6 @@ * @node: * @ns_ptr: * @attribute_name: - * @attr: * * Creates a #GtkWidget that is used to display/edit the * supplied attribute (with name given by the attribute_name @@ -168,16 +164,14 @@ cong_attribute_editor_nmtoken_new (CongDocument *doc, CongNodePtr node, xmlNs *ns_ptr, - const gchar *attribute_name, - xmlAttributePtr attr) + const gchar *attribute_name) { return GTK_WIDGET( cong_attribute_editor_nmtoken_construct (g_object_new (CONG_ATTRIBUTE_EDITOR_NMTOKEN_TYPE, NULL), doc, node, ns_ptr, - attribute_name, - attr)); + attribute_name)); } /* Internal function definitions: */ Index: src/cong-attribute-editor-nmtoken.h =================================================================== RCS file: /cvs/gnome/conglomerate/src/cong-attribute-editor-nmtoken.h,v retrieving revision 1.1 diff -u -r1.1 cong-attribute-editor-nmtoken.h --- src/cong-attribute-editor-nmtoken.h 31 Aug 2004 01:13:50 -0000 1.1 +++ src/cong-attribute-editor-nmtoken.h 15 Oct 2004 14:58:33 -0000 @@ -58,14 +58,12 @@ CongDocument *doc, CongNodePtr node, xmlNs *ns_ptr, - const gchar *attribute_name, - xmlAttributePtr attr); + const gchar *attribute_name); GtkWidget* cong_attribute_editor_nmtoken_new (CongDocument *doc, CongNodePtr node, xmlNs *ns_ptr, - const gchar *attribute_name, - xmlAttributePtr attr); + const gchar *attribute_name); G_END_DECLS Index: src/cong-attribute-editor.c =================================================================== RCS file: /cvs/gnome/conglomerate/src/cong-attribute-editor.c,v retrieving revision 1.14 diff -u -r1.14 cong-attribute-editor.c --- src/cong-attribute-editor.c 31 Aug 2004 01:13:50 -0000 1.14 +++ src/cong-attribute-editor.c 15 Oct 2004 14:58:34 -0000 @@ -39,7 +39,6 @@ CongNodePtr node; xmlNs *ns_ptr; gchar *attribute_name; - xmlAttributePtr attr; /* can be NULL */ gulong handler_id_node_set_attribute; gulong handler_id_node_remove_attribute; @@ -103,7 +102,6 @@ * @node: * @ns_ptr: * @attribute_name: - * @attr: * * TODO: Write me * Returns: @@ -113,17 +111,15 @@ CongDocument *doc, CongNodePtr node, xmlNs *ns_ptr, - const gchar *attribute_name, - xmlAttributePtr attr) + const gchar *attribute_name) { g_return_val_if_fail (IS_CONG_ATTRIBUTE_EDITOR(attribute_editor), NULL); PRIVATE(attribute_editor)->doc = doc; - g_object_ref(doc); /*FIXME: need to unref */ + g_object_ref(doc); PRIVATE(attribute_editor)->node = node; - PRIVATE(attribute_editor)->attribute_name = g_strdup(attribute_name); /* FIXME: need to release */ - PRIVATE(attribute_editor)->attr = attr; + PRIVATE(attribute_editor)->attribute_name = g_strdup(attribute_name); PRIVATE(attribute_editor)->ns_ptr = ns_ptr; @@ -171,21 +167,6 @@ } /** - * cong_attribute_editor_get_attribute: - * @attribute_editor: - * - * TODO: Write me - * Returns: - */ -xmlAttributePtr -cong_attribute_editor_get_attribute (CongAttributeEditor *attribute_editor) -{ - g_return_val_if_fail (IS_CONG_ATTRIBUTE_EDITOR(attribute_editor), NULL); - - return PRIVATE(attribute_editor)->attr; -} - -/** * cong_attribute_editor_get_ns: * @attribute_editor: * @@ -204,7 +185,8 @@ * cong_attribute_editor_get_attribute_name: * @attribute_editor: * - * TODO: Write me + * Returns the name of the attribute. This string should not be freed. + * * Returns: */ const gchar* @@ -326,8 +308,7 @@ return cong_attribute_editor_cdata_new (doc, node, ns_ptr, - attr->name, - attr); + attr->name); case XML_ATTRIBUTE_ID: /* FIXME: extend NMTOKEN thing */ @@ -354,8 +335,7 @@ return cong_attribute_editor_nmtoken_new (doc, node, ns_ptr, - attr->name, - attr); + attr->name); case XML_ATTRIBUTE_NMTOKENS: /* FIXME: use a list view, with buttons to add and delete? */ @@ -367,6 +347,7 @@ ns_ptr, attr->name, attr); + case XML_ATTRIBUTE_NOTATION: /* FIXME: some kind of text entry? */ return gtk_label_new("NOTATION"); Index: src/cong-attribute-editor.h =================================================================== RCS file: /cvs/gnome/conglomerate/src/cong-attribute-editor.h,v retrieving revision 1.9 diff -u -r1.9 cong-attribute-editor.h --- src/cong-attribute-editor.h 31 Aug 2004 01:13:50 -0000 1.9 +++ src/cong-attribute-editor.h 15 Oct 2004 14:58:34 -0000 @@ -57,24 +57,18 @@ GType cong_attribute_editor_get_type (void); -/* it's legitimate for attr to be NULL */ CongAttributeEditor* cong_attribute_editor_construct (CongAttributeEditor *attribute_editor, CongDocument *doc, CongNodePtr node, xmlNs *ns_ptr, - const gchar *attribute_name, - xmlAttributePtr attr); + const gchar *attribute_name); CongDocument* cong_attribute_editor_get_document (CongAttributeEditor *attribute_editor); CongNodePtr cong_attribute_editor_get_node (CongAttributeEditor *attribute_editor); - -/* Result can be NULL */ -xmlAttributePtr -cong_attribute_editor_get_attribute (CongAttributeEditor *attribute_editor); xmlNs * cong_attribute_editor_get_ns (CongAttributeEditor *attribute_editor); Index: src/cong-attribute-wrapper-check-button.c =================================================================== RCS file: /cvs/gnome/conglomerate/src/cong-attribute-wrapper-check-button.c,v retrieving revision 1.6 diff -u -r1.6 cong-attribute-wrapper-check-button.c --- src/cong-attribute-wrapper-check-button.c 23 Jun 2004 17:37:29 -0000 1.6 +++ src/cong-attribute-wrapper-check-button.c 15 Oct 2004 14:58:34 -0000 @@ -91,7 +91,6 @@ * @node: * @ns_ptr: * @attribute_name: - * @attr: * @check_button: * @attribute_value_unchecked: * @attribute_value_checked: @@ -105,7 +104,6 @@ CongNodePtr node, xmlNs *ns_ptr, const gchar *attribute_name, - xmlAttributePtr attr, GtkCheckButton *check_button, const gchar *attribute_value_unchecked, const gchar *attribute_value_checked) @@ -116,8 +114,7 @@ doc, node, ns_ptr, - attribute_name, - attr); + attribute_name); PRIVATE(attribute_wrapper)->check_button = check_button; @@ -140,7 +137,6 @@ * @node: * @ns_ptr: * @attribute_name: - * @attr: * @check_button: * @attribute_value_unchecked: * @attribute_value_checked: @@ -153,7 +149,6 @@ CongNodePtr node, xmlNs *ns_ptr, const gchar *attribute_name, - xmlAttributePtr attr, GtkCheckButton *check_button, const gchar *attribute_value_unchecked, const gchar *attribute_value_checked) @@ -163,7 +158,6 @@ node, ns_ptr, attribute_name, - attr, check_button, attribute_value_unchecked, attribute_value_checked); @@ -186,37 +180,29 @@ static void finalize (GObject *object) { -#if 0 CongAttributeWrapperCheckButton *attribute_wrapper_check_button = CONG_ATTRIBUTE_WRAPPER_CHECK_BUTTON(object); - g_free (attribute_wrapper->private); - attribute_wrapper->private = NULL; + g_free (attribute_wrapper_check_button->private); + attribute_wrapper_check_button->private = NULL; G_OBJECT_CLASS (parent_class)->finalize (object); -#endif } static void dispose (GObject *object) { -#if 0 CongAttributeWrapperCheckButton *attribute_wrapper = CONG_ATTRIBUTE_WRAPPER_CHECK_BUTTON(object); - if (PRIVATE(attribute_wrapper)->doc) { - - g_signal_handler_disconnect (G_OBJECT (PRIVATE(attribute_wrapper)->doc), - PRIVATE(attribute_wrapper)->handler_id_node_set_attribute); - g_signal_handler_disconnect (G_OBJECT (PRIVATE(attribute_wrapper)->doc), - PRIVATE(attribute_wrapper)->handler_id_node_remove_attribute); - - g_object_unref (G_OBJECT (PRIVATE(attribute_wrapper)->doc)); - PRIVATE(attribute_wrapper)->doc = NULL; - - g_free (PRIVATE(attribute_wrapper)->attribute_name); + if (PRIVATE(attribute_wrapper)->attribute_value_unchecked) { + g_free (PRIVATE(attribute_wrapper)->attribute_value_unchecked); + PRIVATE(attribute_wrapper)->attribute_value_unchecked = NULL; + } + if (PRIVATE(attribute_wrapper)->attribute_value_checked) { + g_free (PRIVATE(attribute_wrapper)->attribute_value_checked); + PRIVATE(attribute_wrapper)->attribute_value_checked = NULL; } - + GNOME_CALL_PARENT (G_OBJECT_CLASS, dispose, (object)); -#endif } static void Index: src/cong-attribute-wrapper-check-button.h =================================================================== RCS file: /cvs/gnome/conglomerate/src/cong-attribute-wrapper-check-button.h,v retrieving revision 1.4 diff -u -r1.4 cong-attribute-wrapper-check-button.h --- src/cong-attribute-wrapper-check-button.h 23 Jun 2004 17:37:29 -0000 1.4 +++ src/cong-attribute-wrapper-check-button.h 15 Oct 2004 14:58:34 -0000 @@ -60,7 +60,6 @@ CongNodePtr node, xmlNs *ns_ptr, const gchar *attribute_name, - xmlAttributePtr attr, GtkCheckButton *check_button, const gchar *attribute_value_unchecked, const gchar *attribute_value_checked); @@ -70,7 +69,6 @@ CongNodePtr node, xmlNs *ns_ptr, const gchar *attribute_name, - xmlAttributePtr attr, GtkCheckButton *check_button, const gchar *attribute_value_unchecked, const gchar *attribute_value_checked); Index: src/cong-attribute-wrapper-radio-button.c =================================================================== RCS file: /cvs/gnome/conglomerate/src/cong-attribute-wrapper-radio-button.c,v retrieving revision 1.6 diff -u -r1.6 cong-attribute-wrapper-radio-button.c --- src/cong-attribute-wrapper-radio-button.c 23 Jun 2004 17:37:29 -0000 1.6 +++ src/cong-attribute-wrapper-radio-button.c 15 Oct 2004 14:58:34 -0000 @@ -90,7 +90,6 @@ * @node: * @ns_ptr: * @attribute_name: - * @attr: * @radio_button: * @attribute_value: * @@ -103,7 +102,6 @@ CongNodePtr node, xmlNs *ns_ptr, const gchar *attribute_name, - xmlAttributePtr attr, GtkRadioButton *radio_button, const gchar *attribute_value) { @@ -113,8 +111,7 @@ doc, node, ns_ptr, - attribute_name, - attr); + attribute_name); PRIVATE(attribute_wrapper)->radio_button = radio_button; @@ -135,7 +132,6 @@ * @node: * @ns_ptr: * @attribute_name: - * @attr: * @radio_button: * @attribute_value: * @@ -147,7 +143,6 @@ CongNodePtr node, xmlNs *ns_ptr, const gchar *attribute_name, - xmlAttributePtr attr, GtkRadioButton *radio_button, const gchar *attribute_value) { @@ -156,7 +151,6 @@ node, ns_ptr, attribute_name, - attr, radio_button, attribute_value); @@ -178,37 +172,25 @@ static void finalize (GObject *object) { -#if 0 CongAttributeWrapperRadioButton *attribute_wrapper_radio_button = CONG_ATTRIBUTE_WRAPPER_RADIO_BUTTON(object); - g_free (attribute_wrapper->private); - attribute_wrapper->private = NULL; + g_free (attribute_wrapper_radio_button->private); + attribute_wrapper_radio_button->private = NULL; G_OBJECT_CLASS (parent_class)->finalize (object); -#endif } static void dispose (GObject *object) { -#if 0 - CongAttributeWrapperRadioButton *attribute_wrapper = CONG_ATTRIBUTE_WRAPPER_RADIO_BUTTON(object); + CongAttributeWrapperRadioButton *attribute_wrapper_radio_button = CONG_ATTRIBUTE_WRAPPER_RADIO_BUTTON(object); - if (PRIVATE(attribute_wrapper)->doc) { - - g_signal_handler_disconnect (G_OBJECT (PRIVATE(attribute_wrapper)->doc), - PRIVATE(attribute_wrapper)->handler_id_node_set_attribute); - g_signal_handler_disconnect (G_OBJECT (PRIVATE(attribute_wrapper)->doc), - PRIVATE(attribute_wrapper)->handler_id_node_remove_attribute); - - g_object_unref (G_OBJECT (PRIVATE(attribute_wrapper)->doc)); - PRIVATE(attribute_wrapper)->doc = NULL; - - g_free (PRIVATE(attribute_wrapper)->attribute_name); + if (PRIVATE(attribute_wrapper_radio_button)->attribute_value) { + g_free (PRIVATE(attribute_wrapper_radio_button)->attribute_value); + PRIVATE(attribute_wrapper_radio_button)->attribute_value = NULL; } - + GNOME_CALL_PARENT (G_OBJECT_CLASS, dispose, (object)); -#endif } static void Index: src/cong-attribute-wrapper-radio-button.h =================================================================== RCS file: /cvs/gnome/conglomerate/src/cong-attribute-wrapper-radio-button.h,v retrieving revision 1.4 diff -u -r1.4 cong-attribute-wrapper-radio-button.h --- src/cong-attribute-wrapper-radio-button.h 23 Jun 2004 17:37:29 -0000 1.4 +++ src/cong-attribute-wrapper-radio-button.h 15 Oct 2004 14:58:34 -0000 @@ -60,7 +60,6 @@ CongNodePtr node, xmlNs *ns_ptr, const gchar *attribute_name, - xmlAttributePtr attr, GtkRadioButton *radio_button, const gchar *attribute_value); @@ -69,7 +68,6 @@ CongNodePtr node, xmlNs *ns_ptr, const gchar *attribute_name, - xmlAttributePtr attr, GtkRadioButton *radio_button, const gchar *attribute_value); Index: src/cong-attribute-wrapper.c =================================================================== RCS file: /cvs/gnome/conglomerate/src/cong-attribute-wrapper.c,v retrieving revision 1.10 diff -u -r1.10 cong-attribute-wrapper.c --- src/cong-attribute-wrapper.c 23 Jun 2004 17:37:29 -0000 1.10 +++ src/cong-attribute-wrapper.c 15 Oct 2004 14:58:34 -0000 @@ -37,7 +37,6 @@ CongNodePtr node; gchar *attribute_name; xmlNs *ns_ptr; - xmlAttributePtr attr; /* can be NULL */ gulong handler_id_node_set_attribute; gulong handler_id_node_remove_attribute; @@ -100,7 +99,6 @@ * @node: * @ns_ptr: * @attribute_name: - * @attr: * * TODO: Write me * Returns: @@ -110,17 +108,15 @@ CongDocument *doc, CongNodePtr node, xmlNs *ns_ptr, - const gchar *attribute_name, - xmlAttributePtr attr) + const gchar *attribute_name) { g_return_val_if_fail (IS_CONG_ATTRIBUTE_WRAPPER(attribute_wrapper), NULL); PRIVATE(attribute_wrapper)->doc = doc; - g_object_ref(doc); /*FIXME: need to unref */ + g_object_ref(doc); PRIVATE(attribute_wrapper)->node = node; - PRIVATE(attribute_wrapper)->attribute_name = g_strdup(attribute_name); /* FIXME: need to release */ - PRIVATE(attribute_wrapper)->attr = attr; + PRIVATE(attribute_wrapper)->attribute_name = g_strdup(attribute_name); PRIVATE(attribute_wrapper)->ns_ptr = ns_ptr; @@ -165,21 +161,6 @@ g_return_val_if_fail (IS_CONG_ATTRIBUTE_WRAPPER(attribute_wrapper), NULL); return PRIVATE(attribute_wrapper)->node; -} - -/** - * cong_attribute_wrapper_get_attribute: - * @attribute_wrapper: - * - * TODO: Write me - * Returns: - */ -xmlAttributePtr -cong_attribute_wrapper_get_attribute (CongAttributeWrapper *attribute_wrapper) -{ - g_return_val_if_fail (IS_CONG_ATTRIBUTE_WRAPPER(attribute_wrapper), NULL); - - return PRIVATE(attribute_wrapper)->attr; } /** Index: src/cong-attribute-wrapper.h =================================================================== RCS file: /cvs/gnome/conglomerate/src/cong-attribute-wrapper.h,v retrieving revision 1.4 diff -u -r1.4 cong-attribute-wrapper.h --- src/cong-attribute-wrapper.h 21 Jun 2004 03:34:42 -0000 1.4 +++ src/cong-attribute-wrapper.h 15 Oct 2004 14:58:34 -0000 @@ -56,24 +56,18 @@ GType cong_attribute_wrapper_get_type (void); -/* it's legitimate for attr to be NULL */ CongAttributeWrapper* cong_attribute_wrapper_construct (CongAttributeWrapper *attribute_wrapper, CongDocument *doc, CongNodePtr node, xmlNs *ns_ptr, - const gchar *attribute_name, - xmlAttributePtr attr); + const gchar *attribute_name); CongDocument* cong_attribute_wrapper_get_document (CongAttributeWrapper *attribute_wrapper); CongNodePtr cong_attribute_wrapper_get_node (CongAttributeWrapper *attribute_wrapper); - -/* Result can be NULL */ -xmlAttributePtr -cong_attribute_wrapper_get_attribute (CongAttributeWrapper *attribute_wrapper); xmlNs * cong_attribute_wrapper_get_ns (CongAttributeWrapper *attribute_wrapper); Index: src/cong-glade.c =================================================================== RCS file: /cvs/gnome/conglomerate/src/cong-glade.c,v retrieving revision 1.2 diff -u -r1.2 cong-glade.c --- src/cong-glade.c 23 Jun 2004 17:37:29 -0000 1.2 +++ src/cong-glade.c 15 Oct 2004 14:58:34 -0000 @@ -113,7 +113,6 @@ node, ns_ptr, attribute_name, - NULL, radio_button, attribute_value); cong_attribute_wrapper_bind_to_widget (CONG_ATTRIBUTE_WRAPPER (wrapper), @@ -145,7 +144,6 @@ node, ns_ptr, attribute_name, - NULL, check_button, attribute_value_unchecked, attribute_value_checked); @@ -180,9 +178,7 @@ { GtkWidget *custom_widget; -#if 1 /* for some reason, the string1 stuff is coming through in func_name on my machine: */ - /* FIXME: Should we store the namespace URI somewhere or is the prefix enough. */ const char *local_name; @@ -193,14 +189,7 @@ custom_widget = cong_attribute_editor_cdata_new (global_glade_doc_ptr, global_glade_node_ptr, ns_ptr, - local_name, - NULL); -#else - custom_widget = gtk_label_new(g_strdup_printf("custom widget \"%s\" \"%s\" \"%s\" \"%s\" %i %i", func_name, name, string1, string2, int1, int2)); /* for now */ - - gtk_widget_show_all(custom_widget); -#endif - + local_name); gtk_widget_show (custom_widget); return custom_widget; @@ -233,14 +222,13 @@ GtkWidget *custom_widget; const char *local_name; - xmlNs *ns_ptr = cong_node_get_attr_ns(global_glade_node_ptr, - "lang", - &local_name); + xmlNs *ns_ptr = cong_node_get_attr_ns (global_glade_node_ptr, + "lang", + &local_name); custom_widget = cong_attribute_editor_lang_new (global_glade_doc_ptr, - global_glade_node_ptr, - ns_ptr, - NULL); + global_glade_node_ptr, + ns_ptr); gtk_widget_show_all (custom_widget); return custom_widget;