From: Rico Tzschichholz Date: Mon, 24 Aug 2020 15:03:43 +0000 (+0200) Subject: libvaladoc/girimporter: Fallback to "glib:type-name" for class, interface and record X-Git-Tag: 0.40.24~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=386c98b9c3a75930f3d88f3aa3622d0adcb42043;p=thirdparty%2Fvala.git libvaladoc/girimporter: Fallback to "glib:type-name" for class, interface and record This caused criticals like: valadoc_importer_gir_documentation_importer_attach_comment: assertion 'cname != NULL' failed --- diff --git a/libvaladoc/importer/girdocumentationimporter.vala b/libvaladoc/importer/girdocumentationimporter.vala index 9a9d98b09..1ce11b39c 100644 --- a/libvaladoc/importer/girdocumentationimporter.vala +++ b/libvaladoc/importer/girdocumentationimporter.vala @@ -486,6 +486,9 @@ public class Valadoc.Importer.GirDocumentationImporter : DocumentationImporter { private void parse_record () { start_element ("record"); this.parent_c_identifier = reader.get_attribute ("c:type"); + if (this.parent_c_identifier == null) { + this.parent_c_identifier = reader.get_attribute ("glib:type-name"); + } if (this.parent_c_identifier.has_suffix ("Private")) { this.parent_c_identifier = null; skip_element (); @@ -525,6 +528,9 @@ public class Valadoc.Importer.GirDocumentationImporter : DocumentationImporter { private void parse_class () { start_element ("class"); this.parent_c_identifier = reader.get_attribute ("c:type"); + if (this.parent_c_identifier == null) { + this.parent_c_identifier = reader.get_attribute ("glib:type-name"); + } next (); Api.GirSourceComment? comment = parse_symbol_doc (); @@ -565,6 +571,9 @@ public class Valadoc.Importer.GirDocumentationImporter : DocumentationImporter { private void parse_interface () { start_element ("interface"); this.parent_c_identifier = reader.get_attribute ("c:type"); + if (this.parent_c_identifier == null) { + this.parent_c_identifier = reader.get_attribute ("glib:type-name"); + } next (); Api.GirSourceComment? comment = parse_symbol_doc ();