aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/typesystem.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-07-12 15:19:47 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-07-13 11:02:09 +0000
commita80ae396c4e497a64c3fed57a9c4628436ad40a4 (patch)
tree03bb4cb603c7031470b74889330aa8d358272c84 /sources/shiboken2/ApiExtractor/typesystem.cpp
parent6cd5866c199eb274708605f954954337da695087 (diff)
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 <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/typesystem.cpp')
-rw-r--r--sources/shiboken2/ApiExtractor/typesystem.cpp40
1 files changed, 1 insertions, 39 deletions
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<const PrimitiveTypeEntry*, QString> 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;