[gobject-introspection] Use Node.ctype instead of Node.c_name when looking up comment blocks



commit 9087a67088a001536844e86c891f623eaf77c0e4
Author: Tomeu Vizoso <tomeu vizoso collabora co uk>
Date:   Thu Sep 9 16:04:08 2010 +0200

    Use Node.ctype instead of Node.c_name when looking up comment blocks
    
    We were missing some annotation blocks for structs in typelibs with
    a name different to the C prefix.

 giscanner/maintransformer.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index 01bc7b4..4a9c952 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -168,7 +168,10 @@ class MainTransformer(object):
         if isinstance(node, (ast.Class, ast.Interface, ast.Record,
                              ast.Union, ast.Enum, ast.Bitfield,
                              ast.Callback)):
-            block = self._blocks.get(node.c_name)
+            if node.ctype is not None:
+                block = self._blocks.get(node.ctype)
+            else:
+                block = self._blocks.get(node.c_name)
             self._apply_annotations_annotated(node, block)
         if isinstance(node, (ast.Class, ast.Interface, ast.Record, ast.Union)):
             for field in node.fields:



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