aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/typesystem.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-03-26 13:29:35 +0100
committerCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2019-03-26 20:29:54 +0000
commit066dfadf24b64628fabe25097a86a41f62e73526 (patch)
tree2b59f2caecddc29532489ca845bdafb5e9a93127 /sources/shiboken2/ApiExtractor/typesystem.cpp
parente6b746dc70203689960b8f57d9d6ef0463482415 (diff)
shiboken/Typedatabase: Store type system entries separately
This makes it easier to access the default type system entry, which will always be the first one in the list. Change-Id: Ie0844cef5fa4f0cd8bc50c28898e54a42845c830 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/typesystem.cpp')
-rw-r--r--sources/shiboken2/ApiExtractor/typesystem.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/sources/shiboken2/ApiExtractor/typesystem.cpp b/sources/shiboken2/ApiExtractor/typesystem.cpp
index 204253777..ad97e40ee 100644
--- a/sources/shiboken2/ApiExtractor/typesystem.cpp
+++ b/sources/shiboken2/ApiExtractor/typesystem.cpp
@@ -1509,7 +1509,8 @@ TypeSystemTypeEntry *Handler::parseRootElement(const QXmlStreamReader &,
TypeSystemTypeEntry *moduleEntry =
const_cast<TypeSystemTypeEntry *>(m_database->findTypeSystemType(m_defaultPackage));
- if (!moduleEntry)
+ const bool add = moduleEntry == nullptr;
+ if (add)
moduleEntry = new TypeSystemTypeEntry(m_defaultPackage, since);
moduleEntry->setCodeGeneration(m_generate);
@@ -1517,8 +1518,8 @@ TypeSystemTypeEntry *Handler::parseRootElement(const QXmlStreamReader &,
m_generate == TypeEntry::GenerateNothing) && !m_defaultPackage.isEmpty())
TypeDatabase::instance()->addRequiredTargetImport(m_defaultPackage);
- if (!moduleEntry->qualifiedCppName().isEmpty())
- m_database->addType(moduleEntry);
+ if (add)
+ m_database->addTypeSystemType(moduleEntry);
return moduleEntry;
}