After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 326512 - Patch to correct XML construct from buffer
Patch to correct XML construct from buffer
Status: RESOLVED FIXED
Product: libglademm
Classification: Other
Component: general
git master
Other Linux
: Normal enhancement
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on: 326511
Blocks:
 
 
Reported: 2006-01-10 20:26 UTC by Doug
Modified: 2011-01-16 23:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Doug 2006-01-10 20:26:24 UTC
The existing XML construct from buffer does not attach the new objects to the correct base object.  This results in not being able to register for events on the base object, since they are not passed in.

The problem is its use of glade_xml_new_from_buffer, which creates a new object instead of attaching to the existing one.  Bug 326511 has been entered with a patch to add glade_xml_construct_from_buffer to libglade.  This patch switches the XML construct from buffer method to use that new method, thereby fixing the problem.

Here is the patch:

--- libglademm-2.6.1/libglade/libglademm/xml.cc 2006-01-09 18:27:30.000000000 -0500
+++ libglademm-2.6.1/libglade/libglademm/xml.cc_new     2006-01-09 18:27:15.000000000 -0500
@@ -70,15 +70,16 @@
   }
 }

-// TODO: we need glade_xml_construct_from_buffer()
 Xml::Xml(const char* buffer, int size, const Glib::ustring& root, const Glib::ustring& domain)
 :
-  Glib::ObjectBase(0),
-  Glib::Object((GObject*) glade_xml_new_from_buffer(
-      buffer, size, root.empty() ? 0 : root.c_str(), domain.empty() ? 0 : domain.c_str()))
-{
-  if(!gobj())
+  Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
+  Glib::Object(Glib::ConstructParams(xml_class_.init(), (char*) 0))
+{
+  if(!glade_xml_construct_from_buffer(gobj(), buffer, size, root.empty()   ? 0 : root.c_str(),
+                                                    domain.empty() ? 0 : domain.c_str()))
+  {
     throw XmlError("Failed to read glade input buffer");
+  }
 }

 // static
Comment 1 Murray Cumming 2006-01-13 21:52:38 UTC
By the way, is this needed for an application of yours? Should we try to get it in  before the GNOME 2.13/14 API freeze?
Comment 2 Doug 2006-01-16 15:24:18 UTC
It would be nice if it made it into 2.14.  It is required for a DoD application we are developing.  We are currently running against versions locally patched with this enhancement. 
Comment 3 Doug 2007-04-27 14:52:07 UTC
Can this patch now be applied, since 326511 has been applied to version 2.18?
Comment 4 Murray Cumming 2007-04-27 15:18:58 UTC
Yeah, I'll branch and do that soon. Keep reminding me if I don't. Thanks.
Comment 5 Doug 2007-06-18 16:02:07 UTC
I believe this patch can now be applied.
Comment 6 Murray Cumming 2007-06-18 16:25:52 UTC
Yes. Committed after branching. Please remember to create an svn patch (not patching generated files) with a ChangeLog entry next time.

I am asking for a libglade tarball release so I can do a libglademm release that has this.