diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-10-07 14:12:37 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-10-08 11:39:42 +0200 |
commit | 4761ea81d1789d153ae986be6f749853f5a68332 (patch) | |
tree | 91594cb22e0adcb3d6a62ce3dccb6ad3c2400c1e /sources/shiboken2/generator/shiboken2 | |
parent | 9498d127aaf1a7888e46763ed7b8e39ee76e76da (diff) |
shiboken2: Rearrange values of enum TypeEntry::CodeGeneration
TypeEntry::CodeGeneration::GenerateCpp was unused. Consequently,
the GenerateAll mask is not needed, either.
Replace GenerateCpp and GenerateTargetLang by a generic GenerateCode
value.
Introduce a new GenerationDisabled value to be able to distinguish
a generate='no' XML attribute from a plain rejection.
Fix many invalid usages of bool generateCode() testing against
the flag value.
Use the enum instead of uint for the code generation field.
Task-number: PYSIDE-1202
Change-Id: I0aec5bd1ebfb9a50b80d5a187372c4271490e1b3
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2/generator/shiboken2')
-rw-r--r-- | sources/shiboken2/generator/shiboken2/shibokengenerator.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp index 4f3ca20c1..8cea5aeda 100644 --- a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp +++ b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp @@ -929,7 +929,7 @@ QString ShibokenGenerator::fixedCppTypeName(const TypeEntry *type, QString typeN { if (typeName.isEmpty()) typeName = type->qualifiedCppName(); - if (!(type->codeGeneration() & TypeEntry::GenerateTargetLang)) { + if (!type->generateCode()) { typeName.prepend(QLatin1Char('_')); typeName.prepend(type->targetLangPackage()); } @@ -1609,8 +1609,7 @@ ShibokenGenerator::ExtendedConverterData ShibokenGenerator::getExtendedConverter // Get only the conversion operators that return a type from another module, // that are value-types and were not removed in the type system. const TypeEntry *convType = convOp->type()->typeEntry(); - if ((convType->codeGeneration() & TypeEntry::GenerateTargetLang) - || !convType->isValue() + if (convType->generateCode() || !convType->isValue() || convOp->isModifiedRemoved()) continue; extConvs[convType].append(convOp->ownerClass()); |