aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/ApiExtractor')
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp4
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetalang.cpp19
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetalang.h3
3 files changed, 11 insertions, 15 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
index f5f5beef4..8ff2310e9 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
+++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
@@ -2956,8 +2956,8 @@ void AbstractMetaBuilderPrivate::parseQ_Property(AbstractMetaClass *metaClass,
static AbstractMetaFunction* findCopyCtor(AbstractMetaClass* cls)
{
- AbstractMetaFunctionList functions = cls->queryFunctions(AbstractMetaClass::Invisible);
- functions << cls->queryFunctions(AbstractMetaClass::Visible);
+
+ const auto &functions = cls->functions();
for (AbstractMetaFunction *f : qAsConst(functions)) {
const AbstractMetaFunction::FunctionType t = f->functionType();
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
index 22c119c94..6316cfc43 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
+++ b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
@@ -1829,24 +1829,19 @@ bool AbstractMetaClass::hasConstructors() const
return !queryFunctions(Constructors).isEmpty();
}
-bool AbstractMetaClass::hasCopyConstructor() const
+const AbstractMetaFunction *AbstractMetaClass::copyConstructor() const
{
- const AbstractMetaFunctionList &ctors = queryFunctions(Constructors);
- for (const AbstractMetaFunction* ctor : ctors) {
- if (ctor->functionType() == AbstractMetaFunction::CopyConstructorFunction)
- return true;
+ for (const AbstractMetaFunction *f : m_functions) {
+ if (f->functionType() == AbstractMetaFunction::CopyConstructorFunction)
+ return f;
}
- return false;
+ return nullptr;
}
bool AbstractMetaClass::hasPrivateCopyConstructor() const
{
- const AbstractMetaFunctionList &ctors = queryFunctions(Constructors);
- for (const AbstractMetaFunction *ctor : ctors) {
- if (ctor->functionType() == AbstractMetaFunction::CopyConstructorFunction && ctor->isPrivate())
- return true;
- }
- return false;
+ const AbstractMetaFunction *copyCt = copyConstructor();
+ return copyCt && copyCt->isPrivate();
}
void AbstractMetaClass::addDefaultConstructor()
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.h b/sources/shiboken2/ApiExtractor/abstractmetalang.h
index 130a5f46f..128b76f5d 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetalang.h
+++ b/sources/shiboken2/ApiExtractor/abstractmetalang.h
@@ -1324,7 +1324,8 @@ public:
bool hasSignal(const AbstractMetaFunction *f) const;
bool hasConstructors() const;
- bool hasCopyConstructor() const;
+ const AbstractMetaFunction *copyConstructor() const;
+ bool hasCopyConstructor() const { return copyConstructor() != nullptr; }
bool hasPrivateCopyConstructor() const;
void addDefaultConstructor();