aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
Diffstat (limited to 'sources')
-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; }