diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-10-13 15:33:34 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-10-14 12:14:22 +0200 |
| commit | 84becad3db953a692eb4c1e49531b1fc5d04812f (patch) | |
| tree | 01578c9679c04fdab969c1a7233bdb9c34d89f24 /sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp | |
| parent | 93ae00636551b84ebda8df208f064e132f1c8b5c (diff) | |
shiboken2: Some Refactorings
- AbstractMetaType: Pass TypeEntry to constructor
- AbstractMetaType: Return instantiations() by const ref
- AbstractMetaClass: Make baseTemplateInstantiations a member instead of
a global hash.
Simplify the code accordingly.
Task-number: PYSIDE-1202
Change-Id: I1a18aa4ff97481af8cb13e8732fe3952c48edb29
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp')
| -rw-r--r-- | sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp index b06376866..a2e2841df 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp +++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp @@ -1258,9 +1258,7 @@ void AbstractMetaBuilderPrivate::fixReturnTypeOfConversionOperator(AbstractMetaF if (!retType) return; - auto *metaType = new AbstractMetaType; - metaType->setTypeEntry(retType); - metaFunction->replaceType(metaType); + metaFunction->replaceType(new AbstractMetaType(retType)); } AbstractMetaFunctionList AbstractMetaBuilderPrivate::classFunctionList(const ScopeModelItem &scopeItem, @@ -2010,8 +2008,7 @@ AbstractMetaType *AbstractMetaBuilderPrivate::translateType(const AddedFunction: } // These are only implicit and should not appear in code... - auto *metaType = new AbstractMetaType; - metaType->setTypeEntry(type); + auto *metaType = new AbstractMetaType(type); metaType->setIndirections(typeInfo.indirections); if (typeInfo.isReference) metaType->setReferenceType(LValueReference); @@ -2611,7 +2608,7 @@ bool AbstractMetaBuilderPrivate::inheritTemplate(AbstractMetaClass *subclass, const TypeInfo &info) { QVector<TypeInfo> targs = info.instantiations(); - QVector<AbstractMetaType *> templateTypes; + AbstractMetaTypeList templateTypes; QString errorMessage; if (subclass->isTypeDef()) { @@ -2654,8 +2651,7 @@ bool AbstractMetaBuilderPrivate::inheritTemplate(AbstractMetaClass *subclass, } if (t) { - auto *temporaryType = new AbstractMetaType; - temporaryType->setTypeEntry(t); + auto *temporaryType = new AbstractMetaType(t); temporaryType->setConstant(i.isConstant()); temporaryType->setReferenceType(i.referenceType()); temporaryType->setIndirectionsV(i.indirectionsV()); |
