diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-04-20 10:55:52 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-04-20 18:29:22 +0200 |
commit | 6f5c3727ccbeec0fed45bcb9aef9d0c44340e125 (patch) | |
tree | 152e5e26a47aa67b4ae3e454bb42287c3ea5e68b /sources/shiboken6 | |
parent | 51f9351a4f43c2e0b98dcaa98d19b1292e522686 (diff) |
shiboken6: Remove some unused code
Pick-to: 6.3
Change-Id: Ie5dc344b6daf433f6d7522b05e170a0baa848d32
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken6')
4 files changed, 2 insertions, 82 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp index f0f0ddcd3..86ce3346f 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp +++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp @@ -3164,7 +3164,6 @@ void AbstractMetaBuilderPrivate::inheritTemplateFunctions(AbstractMetaClass *sub auto templateClass = subclass->templateBaseClass(); if (subclass->isTypeDef()) { - subclass->setHasEqualsOperator(templateClass->hasEqualsOperator()); subclass->setHasHashFunction(templateClass->hasHashFunction()); subclass->setHasNonPrivateConstructor(templateClass->hasNonPrivateConstructor()); subclass->setHasPrivateDestructor(templateClass->hasPrivateDestructor()); diff --git a/sources/shiboken6/ApiExtractor/abstractmetafunction.h b/sources/shiboken6/ApiExtractor/abstractmetafunction.h index df7f5de21..71780cc9e 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetafunction.h +++ b/sources/shiboken6/ApiExtractor/abstractmetafunction.h @@ -167,7 +167,6 @@ public: bool isPropertyReader() const; bool isPropertyWriter() const; bool isPropertyResetter() const; - bool isFriendly() const; AbstractMetaFunction(); explicit AbstractMetaFunction(const QString &name); @@ -496,11 +495,6 @@ inline bool AbstractMetaFunction::isPropertyResetter() const return attributes().testFlag(PropertyResetter); } -inline bool AbstractMetaFunction::isFriendly() const -{ - return attributes().testFlag(Friendly); -} - Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractMetaFunction::CompareResult) Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractMetaFunction::Attributes); diff --git a/sources/shiboken6/ApiExtractor/abstractmetalang.cpp b/sources/shiboken6/ApiExtractor/abstractmetalang.cpp index 9b9ba31a0..226840c8f 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetalang.cpp +++ b/sources/shiboken6/ApiExtractor/abstractmetalang.cpp @@ -67,7 +67,6 @@ public: m_hasProtectedDestructor(false), m_hasVirtualDestructor(false), m_hasHashFunction(false), - m_hasEqualsOperator(false), m_isTypeDef(false), m_hasToStringCapability(false), m_valueTypeWithCopyConstructorOnly(false), @@ -107,7 +106,6 @@ public: uint m_hasProtectedDestructor : 1; uint m_hasVirtualDestructor : 1; uint m_hasHashFunction : 1; - uint m_hasEqualsOperator : 1; uint m_isTypeDef : 1; uint m_hasToStringCapability : 1; uint m_valueTypeWithCopyConstructorOnly : 1; @@ -370,26 +368,6 @@ void AbstractMetaClass::setFunctions(const AbstractMetaFunctionCList &functions) } } -bool AbstractMetaClass::hasDefaultToStringFunction() const -{ - const auto &funcs = queryFunctionsByName(QLatin1String("toString")); - for (const auto &f : funcs) { - if (!f->actualMinimumArgumentCount()) - return true; - } - return false; -} - -bool AbstractMetaClass::hasEqualsOperator() const -{ - return d->m_hasEqualsOperator; -} - -void AbstractMetaClass::setHasEqualsOperator(bool on) -{ - d->m_hasEqualsOperator = on; -} - const QList<QPropertySpec> &AbstractMetaClass::propertySpecs() const { return d->m_propertySpecs; @@ -622,15 +600,6 @@ AbstractMetaFunctionCPtr AbstractMetaClass::findQtIsNullMethod() const return *it; } -bool AbstractMetaClass::hasProtectedFunctions() const -{ - for (const auto &func : d->m_functions) { - if (func->isProtected()) - return true; - } - return false; -} - bool AbstractMetaClass::hasProtectedFields() const { for (const AbstractMetaField &field : d->m_fields) { @@ -640,11 +609,6 @@ bool AbstractMetaClass::hasProtectedFields() const return false; } -bool AbstractMetaClass::hasProtectedMembers() const -{ - return hasProtectedFields() || hasProtectedFunctions(); -} - const TypeEntries &AbstractMetaClass::templateArguments() const { return d->m_templateArgs; @@ -1643,26 +1607,6 @@ bool AbstractMetaClass::inheritanceDone() const * Other stuff... */ - -std::optional<AbstractMetaEnum> - AbstractMetaClass::findEnum(const AbstractMetaClassList &classes, - const EnumTypeEntry *entry) -{ - Q_ASSERT(entry->isEnum()); - - auto scopeEntry = entry->parent(); - AbstractMetaClass *metaClass = AbstractMetaClass::findClass(classes, scopeEntry); - if (!metaClass) { - qCWarning(lcShiboken, "%s", qPrintable(msgClassOfEnumNotFound(entry))); - return {}; - } - - QString qualifiedName = entry->qualifiedCppName(); - const int pos = qualifiedName.lastIndexOf(QLatin1String("::")); - const QString enumName = pos > 0 ? qualifiedName.mid(pos + 2) : qualifiedName; - return metaClass->findEnum(enumName); -} - std::optional<AbstractMetaEnumValue> AbstractMetaClass::findEnumValue(const AbstractMetaClassList &classes, const QString &name) diff --git a/sources/shiboken6/ApiExtractor/abstractmetalang.h b/sources/shiboken6/ApiExtractor/abstractmetalang.h index a1709fcd0..7f0de0eea 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetalang.h +++ b/sources/shiboken6/ApiExtractor/abstractmetalang.h @@ -253,23 +253,11 @@ public: bool isPolymorphic() const; /** - * Tells if this class has one or more functions that are protected. - * \return true if the class has protected functions. - */ - bool hasProtectedFunctions() const; - - /** * Tells if this class has one or more fields (member variables) that are protected. * \return true if the class has protected fields. */ bool hasProtectedFields() const; - /** - * Tells if this class has one or more members (functions or fields) that are protected. - * \return true if the class has protected members. - */ - bool hasProtectedMembers() const; - const TypeEntries &templateArguments() const; void setTemplateArguments(const TypeEntries &); @@ -284,13 +272,10 @@ public: void setHasHashFunction(bool on); + /// Returns whether the class has a qHash() overload. Currently unused, + /// specified in type system. bool hasHashFunction() const; - bool hasDefaultToStringFunction() const; - - bool hasEqualsOperator() const; - void setHasEqualsOperator(bool on); - const QList<QPropertySpec> &propertySpecs() const; void addPropertySpec(const QPropertySpec &spec); @@ -361,8 +346,6 @@ public: static std::optional<AbstractMetaEnumValue> findEnumValue(const AbstractMetaClassList &classes, const QString &string); - static std::optional<AbstractMetaEnum> findEnum(const AbstractMetaClassList &classes, - const EnumTypeEntry *entry); SourceLocation sourceLocation() const; void setSourceLocation(const SourceLocation &sourceLocation); |