aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/typesystemparser.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-06-18 11:22:46 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-06-19 21:38:59 +0200
commitab9033719f0ee6319c5f2a4b474aac0eb1ad2ac2 (patch)
tree0ad799fb266e4c7d3db32e62c00d0c1dacf11517 /sources/shiboken2/ApiExtractor/typesystemparser.cpp
parent2d174a7fa78944b094ff7056454236b4560c0092 (diff)
shiboken2: Clean up code injection attributes
Remove the unused enumeration values. Change the class of the "declaration" position from "native" to "shell" since that is where it is used and mention it in the documentation. Task-number: PYSIDE-1282 Change-Id: I547b4bab055df27ce8b0b7b41b9d382dc8f175d1 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.cpp21
1 files changed, 1 insertions, 20 deletions
diff --git a/sources/shiboken2/ApiExtractor/typesystemparser.cpp b/sources/shiboken2/ApiExtractor/typesystemparser.cpp
index 0ba94d94e..0c4d43e76 100644
--- a/sources/shiboken2/ApiExtractor/typesystemparser.cpp
+++ b/sources/shiboken2/ApiExtractor/typesystemparser.cpp
@@ -207,13 +207,8 @@ ENUM_LOOKUP_BEGIN(TypeSystem::Language, Qt::CaseInsensitive,
languageFromAttribute, TypeSystem::NoLanguage)
{
{u"all", TypeSystem::All}, // sorted!
- {u"constructors", TypeSystem::Constructors},
- {u"destructor-function", TypeSystem::DestructorFunction},
- {u"interface", TypeSystem::Interface},
- {u"library-initializer", TypeSystem::PackageInitializer},
{u"native", TypeSystem::NativeCode}, // em algum lugar do cpp
{u"shell", TypeSystem::ShellCode}, // coloca no header, mas antes da declaracao da classe
- {u"shell-declaration", TypeSystem::ShellDeclaration},
{u"target", TypeSystem::TargetLangCode} // em algum lugar do cpp
};
ENUM_LOOKUP_BINARY_SEARCH()
@@ -272,10 +267,7 @@ ENUM_LOOKUP_BEGIN(TypeSystem::CodeSnipPosition, Qt::CaseInsensitive,
{
{u"beginning", TypeSystem::CodeSnipPositionBeginning},
{u"end", TypeSystem::CodeSnipPositionEnd},
- {u"declaration", TypeSystem::CodeSnipPositionDeclaration},
- {u"prototype-initialization", TypeSystem::CodeSnipPositionPrototypeInitialization},
- {u"constructor-initialization", TypeSystem::CodeSnipPositionConstructorInitialization},
- {u"constructor", TypeSystem::CodeSnipPositionConstructor}
+ {u"declaration", TypeSystem::CodeSnipPositionDeclaration}
};
ENUM_LOOKUP_LINEAR_SEARCH()
@@ -2520,19 +2512,8 @@ bool TypeSystemParser::parseInjectCode(const QXmlStreamReader &,
snip.position = position;
snip.language = lang;
- if (snip.language == TypeSystem::Interface
- && topElement.type != StackElement::InterfaceTypeEntry) {
- m_error = QLatin1String("Interface code injections must be direct child of an interface type entry");
- return false;
- }
-
if (topElement.type == StackElement::ModifyFunction
|| topElement.type == StackElement::AddFunction) {
- if (snip.language == TypeSystem::ShellDeclaration) {
- m_error = QLatin1String("no function implementation in shell declaration in which to inject code");
- return false;
- }
-
FunctionModification &mod = m_contextStack.top()->functionMods.last();
mod.snips << snip;
if (!snip.code().isEmpty())