aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-03-22 11:47:20 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2022-03-22 19:14:48 +0100
commit45009f2b4c16e8e5606461a92e0b6447968c816a (patch)
treeb11912dc1f071bb83bb84528c9e5bcbbb13a6883 /sources
parenta08e957dd753c9a5ad5b1646ee3f1e96c57fb25b (diff)
shiboken6: Remove AbstractMetaBuilderPrivate::setupFunctionDefaults()
Move the setting of the declaring/implementing class to AbstractMetaClass::addFunction(). Remove check for "operator_equal", which is apparently a left-over. Task-number: PYSIDE-454 Change-Id: If71d3d8fbee46f09ef7ade708ca425d1613e0ace Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources')
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp19
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h2
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetalang.cpp12
3 files changed, 11 insertions, 22 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
index 33d7ca7cd..b4e9ae310 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
+++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
@@ -301,7 +301,6 @@ void AbstractMetaBuilderPrivate::traverseOperatorFunction(const FunctionModelIte
}
metaFunction->setFlags(flags);
metaFunction->setAccess(Access::Public);
- setupFunctionDefaults(metaFunction, baseoperandClass);
baseoperandClass->addFunction(AbstractMetaFunctionCPtr(metaFunction));
Q_ASSERT(!metaFunction->wasPrivate());
}
@@ -350,7 +349,6 @@ bool AbstractMetaBuilderPrivate::traverseStreamOperator(const FunctionModelItem
funcClass = streamClass;
}
- setupFunctionDefaults(streamFunction, funcClass);
funcClass->addFunction(AbstractMetaFunctionCPtr(streamFunction));
if (funcClass == streamClass)
funcClass->typeEntry()->addExtraInclude(streamedClass->typeEntry()->include());
@@ -1253,21 +1251,6 @@ void AbstractMetaBuilderPrivate::traverseFields(const ScopeModelItem &scope_item
}
}
-void AbstractMetaBuilderPrivate::setupFunctionDefaults(AbstractMetaFunction *metaFunction,
- AbstractMetaClass *metaClass)
-{
- // Set the default value of the declaring class. This may be changed
- // in fixFunctions later on
- metaFunction->setDeclaringClass(metaClass);
-
- // Some of the queries below depend on the implementing class being set
- // to function properly. Such as function modifications
- metaFunction->setImplementingClass(metaClass);
-
- if (metaFunction->name() == QLatin1String("operator_equal"))
- metaClass->setHasEqualsOperator(true);
-}
-
void AbstractMetaBuilderPrivate::fixReturnTypeOfConversionOperator(AbstractMetaFunction *metaFunction)
{
if (!metaFunction->isConversionOperator())
@@ -1379,8 +1362,6 @@ void AbstractMetaBuilderPrivate::traverseFunctions(ScopeModelItem scopeItem,
if (!metaFunction->isDestructor()
&& !(metaFunction->isPrivate() && metaFunction->functionType() == AbstractMetaFunction::ConstructorFunction)) {
- setupFunctionDefaults(metaFunction, metaClass);
-
if (metaFunction->isSignal() && metaClass->hasSignal(metaFunction))
qCWarning(lcShiboken, "%s", qPrintable(msgSignalOverloaded(metaClass, metaFunction)));
diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h b/sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h
index d07389feb..a327acaf6 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h
+++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h
@@ -146,8 +146,6 @@ public:
void setupComparable(AbstractMetaClass *metaClass);
static void setupClonable(AbstractMetaClass *cls);
void setupExternalConversion(AbstractMetaClass *cls);
- static void setupFunctionDefaults(AbstractMetaFunction *metaFunction,
- AbstractMetaClass *metaClass);
static bool isQualifiedCppIdentifier(QStringView e);
QString fixDefaultValue(QString expr, const AbstractMetaType &type,
diff --git a/sources/shiboken6/ApiExtractor/abstractmetalang.cpp b/sources/shiboken6/ApiExtractor/abstractmetalang.cpp
index dc7adfb7f..2c8bf203b 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetalang.cpp
+++ b/sources/shiboken6/ApiExtractor/abstractmetalang.cpp
@@ -429,7 +429,17 @@ void AbstractMetaClassPrivate::addFunction(const AbstractMetaFunctionCPtr &funct
void AbstractMetaClass::addFunction(const AbstractMetaFunctionCPtr &function)
{
- qSharedPointerConstCast<AbstractMetaFunction>(function)->setOwnerClass(this);
+ auto nonConstF = qSharedPointerConstCast<AbstractMetaFunction>(function);
+ nonConstF->setOwnerClass(this);
+
+ // Set the default value of the declaring class. This may be changed
+ // in fixFunctions later on
+ nonConstF->setDeclaringClass(this);
+
+ // Some of the queries below depend on the implementing class being set
+ // to function properly. Such as function modifications
+ nonConstF->setImplementingClass(this);
+
d->addFunction(function);
}