From a80ae396c4e497a64c3fed57a9c4628436ad40a4 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 12 Jul 2018 15:19:47 +0200 Subject: shiboken: Make targetLangPackage() a normal property of TypeEntry Normally, only the root typesystem element has a package specification; there is no need to have virtual functions for it. Task-number: PYSIDE-725 Task-number: PYSIDE-743 Change-Id: I3b86c8418cf16ce372c1953279a115e2eff0e984 Reviewed-by: Christian Tismer --- sources/shiboken2/ApiExtractor/typesystem.cpp | 40 +-------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) (limited to 'sources/shiboken2/ApiExtractor/typesystem.cpp') diff --git a/sources/shiboken2/ApiExtractor/typesystem.cpp b/sources/shiboken2/ApiExtractor/typesystem.cpp index 849351a15..93199d5dc 100644 --- a/sources/shiboken2/ApiExtractor/typesystem.cpp +++ b/sources/shiboken2/ApiExtractor/typesystem.cpp @@ -616,6 +616,7 @@ void Handler::addFlags(const QString &name, QString flagName, { FlagsTypeEntry *ftype = new FlagsTypeEntry(QLatin1String("QFlags<") + name + QLatin1Char('>'), since); ftype->setOriginator(m_currentEnum); + ftype->setTargetLangPackage(m_currentEnum->targetLangPackage()); // Try to get the guess the qualified flag name const int lastSepPos = name.lastIndexOf(colonColon()); if (lastSepPos >= 0 && !flagName.contains(colonColon())) @@ -2131,20 +2132,6 @@ void PrimitiveTypeEntry::setPreferredConversion(bool b) m_preferredConversion = b; } -typedef QHash PrimitiveTypeEntryTargetLangPackageMap; -Q_GLOBAL_STATIC(PrimitiveTypeEntryTargetLangPackageMap, primitiveTypeEntryTargetLangPackages); - -void PrimitiveTypeEntry::setTargetLangPackage(const QString& package) -{ - primitiveTypeEntryTargetLangPackages()->insert(this, package); -} -QString PrimitiveTypeEntry::targetLangPackage() const -{ - if (!primitiveTypeEntryTargetLangPackages()->contains(this)) - return this->::TypeEntry::targetLangPackage(); - return primitiveTypeEntryTargetLangPackages()->value(this); -} - CodeSnipList TypeEntry::codeSnips() const { return m_codeSnips; @@ -2181,11 +2168,6 @@ FieldModification ComplexTypeEntry::fieldModification(const QString &name) const return mod; } -QString ComplexTypeEntry::targetLangPackage() const -{ - return m_package; -} - QString ComplexTypeEntry::targetLangName() const { return m_targetLangName.isEmpty() ? @@ -2212,11 +2194,6 @@ bool ComplexTypeEntry::hasDefaultConstructor() const return complexTypeEntryDefaultConstructors()->contains(this); } -QString ContainerTypeEntry::targetLangPackage() const -{ - return QString(); -} - QString ContainerTypeEntry::targetLangName() const { @@ -2291,11 +2268,6 @@ bool FlagsTypeEntry::preferredConversion() const return false; } -QString FlagsTypeEntry::targetLangPackage() const -{ - return m_enum->targetLangPackage(); -} - QString FlagsTypeEntry::qualifiedTargetLangName() const { return targetLangPackage() + QLatin1Char('.') + m_enum->targetLangQualifier() @@ -2723,16 +2695,6 @@ EnumTypeEntry::EnumTypeEntry(const QString &nspace, const QString &enumName, { } -QString EnumTypeEntry::targetLangPackage() const -{ - return m_packageName; -} - -void EnumTypeEntry::setTargetLangPackage(const QString &package) -{ - m_packageName = package; -} - QString EnumTypeEntry::targetLangName() const { return m_targetLangName; -- cgit v1.2.3