[gi-docgen/validate-links] gir: Store callbacks by name
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gi-docgen/validate-links] gir: Store callbacks by name
- Date: Tue, 25 May 2021 12:18:27 +0000 (UTC)
commit aea099015f0d72e4602a56c4e22783e3c7b990e5
Author: Emmanuele Bassi <ebassi gnome org>
Date: Tue May 25 13:14:09 2021 +0100
gir: Store callbacks by name
Just like other types.
gidocgen/gir/ast.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gidocgen/gir/ast.py b/gidocgen/gir/ast.py
index 430c0ea..13f321e 100644
--- a/gidocgen/gir/ast.py
+++ b/gidocgen/gir/ast.py
@@ -695,7 +695,7 @@ class Namespace:
self._aliases: T.Mapping[str, Alias] = {}
self._bitfields: T.Mapping[str, BitField] = {}
self._boxeds: T.Mapping[str, Boxed] = {}
- self._callbacks: T.List[Callback] = []
+ self._callbacks: T.Mapping[str, Callback] = {}
self._classes: T.Mapping[str, Class] = {}
self._constants: T.Mapping[str, Constant] = {}
self._enumerations: T.Mapping[str, Enumeration] = {}
@@ -764,7 +764,7 @@ class Namespace:
self._function_macros[function.name] = function
def add_callback(self, callback: Callback) -> None:
- self._callbacks.append(callback)
+ self._callbacks[callback.name] = callback
def get_classes(self) -> T.List[Class]:
return self._classes.values()
@@ -841,7 +841,7 @@ class Namespace:
return [x for x in self._function_macros.values() if is_effective(x, self)]
def get_callbacks(self) -> T.List[Callback]:
- return self._callbacks
+ return self._callbacks.values()
def find_class(self, cls: str) -> T.Optional[Class]:
return self._classes.get(cls)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]