aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-03-20 13:41:08 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-03-20 14:47:44 +0000
commite909528a77172bbd129ca08c12a62ba182dcbf8c (patch)
tree9d5477bd11a0196383d99cf408da6596b45c4580 /sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
parentc0863716bf33347089879316d09ac25b62ee89cd (diff)
siboken/Typesystem: Replace double used for versions by QVersionNumber
- Change TypeSystemEntry::m_version from double to QVersionNumber. - Determine version at the beginning of the start element processing of the parser and use that. - Remove AddedFunction::m_version which is not needed. - Remove unused parameter double vr from AbstractMetaBuilderPrivate::translateType(). Change-Id: I2941667ba565f8c11aa0c14446ec7d6934da99dc Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp')
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
index 37b82e99f..1afc7d135 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
+++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
@@ -1053,7 +1053,7 @@ AbstractMetaEnum *AbstractMetaBuilderPrivate::traverseEnum(EnumModelItem enumIte
QString nspace;
if (names.size() > 1)
nspace = QStringList(names.mid(0, names.size() - 1)).join(colonColon());
- typeEntry = new EnumTypeEntry(nspace, enumName, 0);
+ typeEntry = new EnumTypeEntry(nspace, enumName, QVersionNumber(0, 0));
TypeDatabase::instance()->addType(typeEntry);
} else if (!enumItem->isAnonymous()) {
typeEntry = TypeDatabase::instance()->findType(qualifiedName);
@@ -1937,7 +1937,7 @@ AbstractMetaFunction* AbstractMetaBuilderPrivate::traverseFunction(const AddedFu
metaFunction->setUserAdded(true);
AbstractMetaAttributes::Attribute isStatic = addedFunc.isStatic() ? AbstractMetaFunction::Static : AbstractMetaFunction::None;
metaFunction->setAttributes(metaFunction->attributes() | AbstractMetaAttributes::FinalInTargetLang | isStatic);
- metaFunction->setType(translateType(addedFunc.version(), addedFunc.returnType()));
+ metaFunction->setType(translateType(addedFunc.returnType()));
QVector<AddedFunction::TypeInfo> args = addedFunc.arguments();
@@ -1946,7 +1946,7 @@ AbstractMetaFunction* AbstractMetaBuilderPrivate::traverseFunction(const AddedFu
for (int i = 0; i < args.count(); ++i) {
AddedFunction::TypeInfo& typeInfo = args[i];
AbstractMetaArgument *metaArg = new AbstractMetaArgument;
- AbstractMetaType* type = translateType(addedFunc.version(), typeInfo);
+ AbstractMetaType *type = translateType(typeInfo);
decideUsagePattern(type);
metaArg->setType(type);
metaArg->setArgumentIndex(i);
@@ -2404,8 +2404,7 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(FunctionModel
return metaFunction;
}
-AbstractMetaType *AbstractMetaBuilderPrivate::translateType(double vr,
- const AddedFunction::TypeInfo &typeInfo)
+AbstractMetaType *AbstractMetaBuilderPrivate::translateType(const AddedFunction::TypeInfo &typeInfo)
{
Q_ASSERT(!typeInfo.name.isEmpty());
TypeDatabase* typeDb = TypeDatabase::instance();
@@ -2462,7 +2461,7 @@ AbstractMetaType *AbstractMetaBuilderPrivate::translateType(double vr,
metaType->setConstant(typeInfo.isConstant);
if (isTemplate) {
for (const QString& templateArg : qAsConst(templateArgs)) {
- AbstractMetaType* metaArgType = translateType(vr, AddedFunction::TypeInfo::fromSignature(templateArg));
+ AbstractMetaType *metaArgType = translateType(AddedFunction::TypeInfo::fromSignature(templateArg));
metaType->addInstantiation(metaArgType);
}
metaType->setTypeUsagePattern(AbstractMetaType::ContainerPattern);