diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-28 08:36:19 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-28 11:45:00 +0000 |
commit | 2f548c62d50b49e193c9f7575fa6a4601b697609 (patch) | |
tree | 042722f87bfbfb00740e0a43719298088e421482 /sources/shiboken2/generator | |
parent | 2e2c845c28bdde8b5350d933910b8e2969776260 (diff) |
shiboken: Refactor finding of enums
In the AbstractMetaBuilder, change the list of enums into a QHash with the type entry as key
since that is mostly used for searching. Streamline and simplify
the search functionality accordingly.
Task-number: PYSIDE-817
Change-Id: I205cad1f90bc26511ea6b6e9b76ddb1bae544cf1
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/generator')
-rw-r--r-- | sources/shiboken2/generator/generator.cpp | 12 | ||||
-rw-r--r-- | sources/shiboken2/generator/generator.h | 6 |
2 files changed, 1 insertions, 17 deletions
diff --git a/sources/shiboken2/generator/generator.cpp b/sources/shiboken2/generator/generator.cpp index 21962b272..e5df11dc8 100644 --- a/sources/shiboken2/generator/generator.cpp +++ b/sources/shiboken2/generator/generator.cpp @@ -334,24 +334,14 @@ ContainerTypeEntryList Generator::containerTypes() const return m_d->apiextractor->containerTypes(); } -const AbstractMetaEnum* Generator::findAbstractMetaEnum(const EnumTypeEntry* typeEntry) const -{ - return m_d->apiextractor->findAbstractMetaEnum(typeEntry); -} - const AbstractMetaEnum* Generator::findAbstractMetaEnum(const TypeEntry* typeEntry) const { return m_d->apiextractor->findAbstractMetaEnum(typeEntry); } -const AbstractMetaEnum* Generator::findAbstractMetaEnum(const FlagsTypeEntry* typeEntry) const -{ - return m_d->apiextractor->findAbstractMetaEnum(typeEntry); -} - const AbstractMetaEnum* Generator::findAbstractMetaEnum(const AbstractMetaType* metaType) const { - return m_d->apiextractor->findAbstractMetaEnum(metaType); + return m_d->apiextractor->findAbstractMetaEnum(metaType->typeEntry()); } QString Generator::licenseComment() const diff --git a/sources/shiboken2/generator/generator.h b/sources/shiboken2/generator/generator.h index a8f008e33..1af934871 100644 --- a/sources/shiboken2/generator/generator.h +++ b/sources/shiboken2/generator/generator.h @@ -288,15 +288,9 @@ protected: /// Returns all container types found by APIExtractor ContainerTypeEntryList containerTypes() const; - /// Returns an AbstractMetaEnum for a given EnumTypeEntry, or NULL if not found. - const AbstractMetaEnum* findAbstractMetaEnum(const EnumTypeEntry* typeEntry) const; - /// Returns an AbstractMetaEnum for a given TypeEntry that is an EnumTypeEntry, or NULL if not found. const AbstractMetaEnum* findAbstractMetaEnum(const TypeEntry* typeEntry) const; - /// Returns an AbstractMetaEnum for the enum related to a given FlagsTypeEntry, or NULL if not found. - const AbstractMetaEnum* findAbstractMetaEnum(const FlagsTypeEntry* typeEntry) const; - /// Returns an AbstractMetaEnum for a given AbstractMetaType that holds an EnumTypeEntry, or NULL if not found. const AbstractMetaEnum* findAbstractMetaEnum(const AbstractMetaType* metaType) const; |