aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/typesystemparser.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-02-06 08:32:45 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-02-06 09:04:10 +0100
commitba366999c39e864b2999e6df2693ced3dbe34046 (patch)
treed4833c55e150e42b5ab926e53fbcc301f06a3c16 /sources/shiboken2/ApiExtractor/typesystemparser.cpp
parent7d357fc2a3047eb9e2458a293c9fe1b85e8f1772 (diff)
shiboken: Remove InterfaceTypeEntry
InterfaceTypeEntry is a relic from Java, which does not have multiple inheritance. Remove it and handle it as object-type. Just removing the code breaks tests though, since AbstractMetaClass only has one pointer to its base class. The other base classes are added to the interface list. FAIL! shiboken2:testmultipleinheritance Newly detected Real test failure! FAIL! shiboken2:sample::ownership_invalidate_after_use Newly detected Real test failure! FAIL! shiboken2:sample::visibilitychange Newly detected Real test failure! [ChangeLog][shiboken] interface-type has been deprecated. object-type should be used instead. Change-Id: I19e876d82b26c2ef7865e3fafc74503c6cbd5a8b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/typesystemparser.cpp')
-rw-r--r--sources/shiboken2/ApiExtractor/typesystemparser.cpp55
1 files changed, 1 insertions, 54 deletions
diff --git a/sources/shiboken2/ApiExtractor/typesystemparser.cpp b/sources/shiboken2/ApiExtractor/typesystemparser.cpp
index 0e28e8602..55b079edd 100644
--- a/sources/shiboken2/ApiExtractor/typesystemparser.cpp
+++ b/sources/shiboken2/ApiExtractor/typesystemparser.cpp
@@ -804,11 +804,6 @@ bool TypeSystemParser::endElement(const QStringRef &localName)
centry->setFieldModifications(m_contextStack.top()->fieldMods);
centry->setCodeSnips(m_contextStack.top()->codeSnips);
centry->setDocModification(m_contextStack.top()->docModifications);
-
- if (centry->designatedInterface()) {
- centry->designatedInterface()->setCodeSnips(m_contextStack.top()->codeSnips);
- centry->designatedInterface()->setFunctionModifications(m_contextStack.top()->functionMods);
- }
}
break;
case StackElement::AddFunction: {
@@ -1344,40 +1339,6 @@ EnumTypeEntry *
return entry;
}
-ObjectTypeEntry *
- TypeSystemParser::parseInterfaceTypeEntry(const QXmlStreamReader &,
- const QString &name, const QVersionNumber &since,
- QXmlStreamAttributes *attributes)
-{
- if (!checkRootElement())
- return nullptr;
- auto *otype = new ObjectTypeEntry(name, since, currentParentTypeEntry());
- applyCommonAttributes(otype, attributes);
- QString targetLangName = name;
- bool generate = true;
- for (int i = attributes->size() - 1; i >= 0; --i) {
- const QStringRef name = attributes->at(i).qualifiedName();
- if (name == targetLangNameAttribute()) {
- targetLangName = attributes->takeAt(i).value().toString();
- } else if (name == generateAttribute()) {
- generate = convertBoolean(attributes->takeAt(i).value(),
- generateAttribute(), true);
- }
- }
-
- auto itype = new InterfaceTypeEntry(InterfaceTypeEntry::interfaceName(targetLangName),
- since, currentParentTypeEntry());
- itype->setTargetLangName(targetLangName);
-
- if (generate)
- itype->setCodeGeneration(m_generate);
- else
- itype->setCodeGeneration(TypeEntry::GenerateForSubclass);
-
- otype->setDesignatedInterface(itype);
- itype->setOrigin(otype);
- return otype;
-}
NamespaceTypeEntry *
TypeSystemParser::parseNamespaceTypeEntry(const QXmlStreamReader &reader,
@@ -1590,9 +1551,6 @@ void TypeSystemParser::applyComplexTypeAttributes(const QXmlStreamReader &reader
if (ctype->type() != TypeEntry::ContainerType)
ctype->setTargetLangPackage(package);
- if (InterfaceTypeEntry *di = ctype->designatedInterface())
- di->setTargetLangPackage(package);
-
if (generate)
ctype->setCodeGeneration(m_generate);
else
@@ -2628,10 +2586,6 @@ bool TypeSystemParser::parseInclude(const QXmlStreamReader &,
m_error = QLatin1String("Only supported parent tags are primitive-type, complex types or extra-includes");
return false;
}
- if (InterfaceTypeEntry *di = entry->designatedInterface()) {
- di->setInclude(entry->include());
- di->setExtraIncludes(entry->extraIncludes());
- }
return true;
}
@@ -2881,14 +2835,6 @@ bool TypeSystemParser::startElement(const QXmlStreamReader &reader)
element->entry = m_currentEnum;
break;
- case StackElement::InterfaceTypeEntry:
- if (ObjectTypeEntry *oe = parseInterfaceTypeEntry(reader, name, versionRange.since, &attributes)) {
- applyComplexTypeAttributes(reader, oe, &attributes);
- element->entry = oe;
- } else {
- return false;
- }
- break;
case StackElement::ValueTypeEntry:
if (ValueTypeEntry *ve = parseValueTypeEntry(reader, name, versionRange.since, &attributes)) {
applyComplexTypeAttributes(reader, ve, &attributes);
@@ -2904,6 +2850,7 @@ bool TypeSystemParser::startElement(const QXmlStreamReader &reader)
return false;
break;
case StackElement::ObjectTypeEntry:
+ case StackElement::InterfaceTypeEntry:
if (!checkRootElement())
return false;
element->entry = new ObjectTypeEntry(name, versionRange.since, currentParentTypeEntry());