diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-06-13 15:55:24 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-06-13 16:24:44 +0200 |
commit | 6e77dec18651a023b8447ed7ce64c2a1db6e2462 (patch) | |
tree | 80a64fbfb934bb282458fea6c8311ce149342c84 /sources | |
parent | 80a6f91c553eaf9ed4d7d002a5abb442693e8e08 (diff) |
shiboken: Generate code for smart pointers only within declaring package
Check on the type entry whether code needs to be generated in the
current package.
Fixes: PYSIDE-1024
Change-Id: I82132b077ac6192b96d979cb5596d0e6fecbc76b
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources')
-rw-r--r-- | sources/shiboken2/generator/generator.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sources/shiboken2/generator/generator.cpp b/sources/shiboken2/generator/generator.cpp index 46ad90724..49064a6a5 100644 --- a/sources/shiboken2/generator/generator.cpp +++ b/sources/shiboken2/generator/generator.cpp @@ -219,9 +219,12 @@ void Generator::addInstantiatedContainersAndSmartPointers(const AbstractMetaType const AbstractMetaTypeList &instantiations = type->instantiations(); for (const AbstractMetaType* t : instantiations) addInstantiatedContainersAndSmartPointers(t, context); - if (!type->typeEntry()->isContainer() && !type->typeEntry()->isSmartPointer()) + const auto typeEntry = type->typeEntry(); + const bool isContainer = typeEntry->isContainer(); + if (!isContainer + && !(typeEntry->isSmartPointer() && typeEntry->generateCode())) { return; - bool isContainer = type->typeEntry()->isContainer(); + } if (type->hasTemplateChildren()) { QString piece = isContainer ? QStringLiteral("container") : QStringLiteral("smart pointer"); QString warning = |