[gobject-introspection] giscanner: Don't prefer identifier prefixes over namespaces in deps



commit 451488516e3526e905f1ceb127e89321db91b3ef
Author: Stef Walter <stefw gnome org>
Date:   Tue Oct 23 21:38:48 2012 +0200

    giscanner: Don't prefer identifier prefixes over namespaces in deps
    
    Use namespaces in dependencies before falling back to the deprecated
    --identifier-prefix prefixes.

 giscanner/transformer.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/giscanner/transformer.py b/giscanner/transformer.py
index dfd2550..b96e141 100644
--- a/giscanner/transformer.py
+++ b/giscanner/transformer.py
@@ -154,7 +154,8 @@ namespaces."""
             (ns, giname) = name.split('.', 1)
             if ns == self._namespace.name:
                 return self._namespace.get(giname)
-            if ns in self._namespace.identifier_prefixes:
+            # Fallback to the main namespace if not a dependency and matches a prefix
+            if ns in self._namespace.identifier_prefixes and not ns in self._includes:
                 message.warn(("Deprecated reference to identifier " +
                               "prefix %s in GIName %s") % (ns, name))
                 return self._namespace.get(giname)



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