aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/typesystem.cpp
diff options
context:
space:
mode:
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;
}