Branch: refs/heads/master Author: Thomas Martitz kugel@rockbox.org Committer: Thomas Martitz kugel@rockbox.org Date: Mon, 14 Mar 2016 07:26:45 UTC Commit: 0bafb067b9ce0b1d5218f7523473052bcd0dab75 https://github.com/geany/geany/commit/0bafb067b9ce0b1d5218f7523473052bcd0dab...
Log Message: ----------- gtkdoc: fix gtkdoc header script for structs with inline types
Doxygen adds unhandled xml output for structs that define types inline, for example struct Foo { enum { FOO, BAR } baz; }. A type definitions precedes the members. The script wrongly assumed the first sectiondef child of compounddef would contain all members, but actually this is the case for sectiondefs with kind=public-attrib (the sectiondef defining the type has kind=public-type).
Modified Paths: -------------- scripts/gen-api-gtkdoc.py
Modified: scripts/gen-api-gtkdoc.py 6 lines changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -292,9 +292,9 @@ class DoxyStruct(DoxyElement): @staticmethod def from_compounddef(xml, typedefs=[]): name = xml.find("compoundname").text - section = xml.find("sectiondef") d = "struct %s {\n" % name - for p in section.findall("memberdef"): + memberdefs = xml.xpath(".//sectiondef[@kind='public-attrib']/memberdef") + for p in memberdefs: # workaround for struct members. g-ir-scanner can't properly map struct members # (beginning with struct GeanyFoo) to the typedef and assigns a generic type for them # thus we fix that up here and enforce usage of the typedef. These are written @@ -314,7 +314,7 @@ def from_compounddef(xml, typedefs=[]): d += "};\n" e = DoxyStruct(name, d) e.add_brief(xml.find("briefdescription")) - for p in section.findall("memberdef"): + for p in memberdefs: e.add_member(p) return e
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).