aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-12-09 08:19:58 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-12-10 13:38:42 +0000
commitede91060ff2f8282b2462ef33799405e4ab9f60a (patch)
tree8a265e389dcbaffee1b39fa5ca0f40ad0fa871c8 /sources/shiboken6
parent5062dee6c6b08d6f622e92e92d2998423fe8ee7b (diff)
shiboken6: Remove function type enumeration value GlobalScopeFunction
It has no use since member functions and global functions are stored in separate lists anyways. Change-Id: Ib64f53f7f043ea70f7e995d14515385dfb9fbc03 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 48fbcdd4da141c639daafa8b92d42ab12a3af66f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'sources/shiboken6')
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp1
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetafunction.cpp8
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetafunction.h3
3 files changed, 7 insertions, 5 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
index 45c594b5f..c6b50a94e 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
+++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
@@ -308,7 +308,6 @@ void AbstractMetaBuilderPrivate::traverseStreamOperator(const FunctionModelItem
AbstractMetaFunction *streamFunction = traverseFunction(item, streamedClass);
if (streamFunction) {
- streamFunction->setFunctionType(AbstractMetaFunction::GlobalScopeFunction);
// Strip first argument, since that is the containing object
AbstractMetaArgumentList arguments = streamFunction->arguments();
if (!streamClass->typeEntry()->generateCode())
diff --git a/sources/shiboken6/ApiExtractor/abstractmetafunction.cpp b/sources/shiboken6/ApiExtractor/abstractmetafunction.cpp
index 9594cfdb6..7b05d3207 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetafunction.cpp
+++ b/sources/shiboken6/ApiExtractor/abstractmetafunction.cpp
@@ -201,7 +201,7 @@ AbstractMetaFunction::~AbstractMetaFunction() = default;
*/
bool AbstractMetaFunction::isModifiedRemoved(const AbstractMetaClass *cls) const
{
- if (d->m_functionType != GlobalScopeFunction && cls == nullptr)
+ if (!isInGlobalScope() && cls == nullptr)
cls = d->m_implementingClass;
for (const auto &mod : modifications(cls)) {
if (mod.isRemoved())
@@ -556,6 +556,11 @@ bool AbstractMetaFunction::isNormal() const
return functionType() == NormalFunction || isSlot() || isInGlobalScope();
}
+bool AbstractMetaFunction::isInGlobalScope() const
+{
+ return d->m_class == nullptr;
+}
+
AbstractMetaFunction::FunctionType AbstractMetaFunction::functionType() const
{
return d->m_functionType;
@@ -1150,7 +1155,6 @@ TypeSystem::SnakeCase AbstractMetaFunction::snakeCase() const
case AbstractMetaFunction::SignalFunction:
case AbstractMetaFunction::EmptyFunction:
case AbstractMetaFunction::SlotFunction:
- case AbstractMetaFunction::GlobalScopeFunction:
if (isOperatorOverload())
return TypeSystem::SnakeCase::Disabled;
break;
diff --git a/sources/shiboken6/ApiExtractor/abstractmetafunction.h b/sources/shiboken6/ApiExtractor/abstractmetafunction.h
index 99174b47f..30a3dbae7 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetafunction.h
+++ b/sources/shiboken6/ApiExtractor/abstractmetafunction.h
@@ -64,7 +64,6 @@ public:
SignalFunction,
EmptyFunction,
SlotFunction,
- GlobalScopeFunction,
GetAttroFunction,
SetAttroFunction
};
@@ -193,7 +192,7 @@ public:
bool isDestructor() const { return functionType() == DestructorFunction; }
bool isConstructor() const;
bool isNormal() const;
- bool isInGlobalScope() const { return functionType() == GlobalScopeFunction; }
+ bool isInGlobalScope() const;
bool isSignal() const { return functionType() == SignalFunction; }
bool isSlot() const { return functionType() == SlotFunction; }
bool isEmptyFunction() const { return functionType() == EmptyFunction; }