summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiovanni Campagna <gcampagna@src.gnome.org>2012-06-16 14:59:32 +0200
committerGiovanni Campagna <gcampagna@src.gnome.org>2012-06-16 15:15:21 +0200
commit981f0111c39725cf9b25c50d5b130b14f47dd8dd (patch)
tree113feb7e66246df850454223d6b597c8d764cfa3
parent5ae4c8763e4fcf94f43201f0d7aa8a13586a2fea (diff)
downloadgobject-introspection-981f0111c39725cf9b25c50d5b130b14f47dd8dd.tar.gz
scanner: fix pairing of error quarks with registered enums
_uscore_type_names maps from the c_symbol_prefix, which has the global ns prefix removed, so we need to split the function symbol before the lookup. Previously it worked because it used the heuristics for unregistered enums (and failed for GDBusError, which has two uppercase letters in succession) https://bugzilla.gnome.org/show_bug.cgi?id=669350
-rw-r--r--giscanner/maintransformer.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index bb10c99d..850d2424 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -917,15 +917,17 @@ the ones that failed to resolve removed."""
for node in self._namespace.itervalues():
if not isinstance(node, ast.ErrorQuarkFunction):
continue
- short = node.symbol[:-len('_quark')]
- if short == "g_io_error":
+ full = node.symbol[:-len('_quark')]
+ ns, short = self._transformer.split_csymbol(node.symbol)
+ short = short[:-len('_quark')]
+ if full == "g_io_error":
# Special case; GIOError was already taken forcing GIOErrorEnum
assert self._namespace.name == 'Gio'
enum = self._namespace.get('IOErrorEnum')
else:
enum = self._uscore_type_names.get(short)
if enum is None:
- enum = uscore_enums.get(short)
+ enum = uscore_enums.get(full)
if enum is not None:
enum.error_domain = node.error_domain
else: