[vala/0.48] libvaladoc/girimporter: Fallback to "glib:type-name" for class, interface and record



commit fca3ddafaa0e5d0e79d0da6a91116a2c4fd70cb7
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Mon Aug 24 17:03:43 2020 +0200

    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

 libvaladoc/importer/girdocumentationimporter.vala | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/libvaladoc/importer/girdocumentationimporter.vala 
b/libvaladoc/importer/girdocumentationimporter.vala
index 7be872f22..b528a178d 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 ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]