From 7c83f2ebc1ac55c6e2556c8c852716502dcdba5a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 28 Feb 2018 10:13:15 +0100 Subject: shiboken: Remove unused code related to enumerations Remove class struct EnumValueRedirection and add explanatory comment to EnumValueTypeEntry. Change-Id: Ic4665436f301943805c7985188bc41c4ad3e8336 Reviewed-by: Alexandru Croitor --- sources/shiboken2/ApiExtractor/typesystem.cpp | 13 ------------- sources/shiboken2/ApiExtractor/typesystem.h | 18 ++---------------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/sources/shiboken2/ApiExtractor/typesystem.cpp b/sources/shiboken2/ApiExtractor/typesystem.cpp index 38a2a60bf..749ce2f71 100644 --- a/sources/shiboken2/ApiExtractor/typesystem.cpp +++ b/sources/shiboken2/ApiExtractor/typesystem.cpp @@ -2279,19 +2279,6 @@ QString FlagsTypeEntry::targetLangPackage() const return m_enum->targetLangPackage(); } -void EnumTypeEntry::addEnumValueRedirection(const QString &rejected, const QString &usedValue) -{ - m_enumRedirections << EnumValueRedirection(rejected, usedValue); -} - -QString EnumTypeEntry::enumValueRedirection(const QString &value) const -{ - for (int i = 0; i < m_enumRedirections.size(); ++i) - if (m_enumRedirections.at(i).rejected == value) - return m_enumRedirections.at(i).used; - return QString(); -} - QString FlagsTypeEntry::qualifiedTargetLangName() const { return targetLangPackage() + QLatin1Char('.') + m_enum->targetLangQualifier() diff --git a/sources/shiboken2/ApiExtractor/typesystem.h b/sources/shiboken2/ApiExtractor/typesystem.h index c8a1c88fa..f2b5a9320 100644 --- a/sources/shiboken2/ApiExtractor/typesystem.h +++ b/sources/shiboken2/ApiExtractor/typesystem.h @@ -1042,18 +1042,6 @@ private: PrimitiveTypeEntry* m_referencedTypeEntry = nullptr; }; -struct EnumValueRedirection -{ - EnumValueRedirection() {} - EnumValueRedirection(const QString &rej, const QString &us) - : rejected(rej), - used(us) - { - } - QString rejected; - QString used; -}; - class EnumTypeEntry : public TypeEntry { public: @@ -1133,9 +1121,6 @@ public: return m_rejectedEnums; } - void addEnumValueRedirection(const QString &rejected, const QString &usedValue); - QString enumValueRedirection(const QString &value) const; - bool forceInteger() const { return m_forceInteger; @@ -1163,7 +1148,6 @@ private: QString m_upperBound; QStringList m_rejectedEnums; - QVector m_enumRedirections; FlagsTypeEntry *m_flags = nullptr; @@ -1172,6 +1156,8 @@ private: bool m_anonymous = false; }; +// EnumValueTypeEntry is used for resolving integer type templates +// like array. class EnumValueTypeEntry : public TypeEntry { public: -- cgit v1.2.3