aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-07-27 14:43:19 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-07-31 06:45:16 +0000
commit83a3459eaa30669b50d07c0341eee48c43197424 (patch)
treec8775d645fe694cd0698ae0077dfaf7c1c2c78a8 /sources/shiboken2/ApiExtractor
parent8c3b9c0d847656f7a254490047d40cf54e2847a1 (diff)
shiboken: Code cleanup
Remove code working around a Qt bug and a modification on a type entry name which was apparently intended to strip off qualifiers using a regex, but has no effect since the QString overload was called. Remove check for null in AbstractMetaBuilderPrivate::addAbstractMetaClass() and modify call sites accordingly. Change-Id: I7ab2a163fe558af09f2c7989bdec1561e9bbb203 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor')
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp14
-rw-r--r--sources/shiboken2/ApiExtractor/typesystem.cpp10
2 files changed, 5 insertions, 19 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
index 73928cd6f..b0c212f89 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
+++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
@@ -476,11 +476,8 @@ void AbstractMetaBuilderPrivate::traverseDom(const FileModelItem &dom)
for (const ClassModelItem &item : typeValues) {
ReportHandler::progress(QStringLiteral("Generating class model (%1)...")
.arg(typeValues.size()));
- AbstractMetaClass *cls = traverseClass(dom, item);
- if (!cls)
- continue;
-
- addAbstractMetaClass(cls);
+ if (AbstractMetaClass *cls = traverseClass(dom, item))
+ addAbstractMetaClass(cls);
}
// We need to know all global enums
@@ -513,8 +510,8 @@ void AbstractMetaBuilderPrivate::traverseDom(const FileModelItem &dom)
for (const TypeDefModelItem &typeDef : typeDefs) {
ReportHandler::progress(QStringLiteral("Resolving typedefs (%1)...")
.arg(typeDefs.size()));
- AbstractMetaClass* cls = traverseTypeDef(dom, typeDef);
- addAbstractMetaClass(cls);
+ if (AbstractMetaClass *cls = traverseTypeDef(dom, typeDef))
+ addAbstractMetaClass(cls);
}
for (const ClassModelItem &item : typeValues)
@@ -768,9 +765,6 @@ void AbstractMetaBuilder::setLogDirectory(const QString& logDir)
void AbstractMetaBuilderPrivate::addAbstractMetaClass(AbstractMetaClass *cls)
{
- if (!cls)
- return;
-
cls->setOriginalAttributes(cls->attributes());
if (cls->typeEntry()->isContainer()) {
m_templates << cls;
diff --git a/sources/shiboken2/ApiExtractor/typesystem.cpp b/sources/shiboken2/ApiExtractor/typesystem.cpp
index 575bab4d4..14b47ae8e 100644
--- a/sources/shiboken2/ApiExtractor/typesystem.cpp
+++ b/sources/shiboken2/ApiExtractor/typesystem.cpp
@@ -133,21 +133,13 @@ struct EnumLookup
template <class EnumType, Qt::CaseSensitivity cs>
bool operator==(const EnumLookup<EnumType, cs> &e1, const EnumLookup<EnumType, cs> &e2)
{
-#ifdef QTBUG_69389_FIXED
return e1.name.compare(e2.name, cs) == 0;
-#else
- return QtPrivate::compareStrings(e1.name, e2.name, cs) == 0;
-#endif
}
template <class EnumType, Qt::CaseSensitivity cs>
bool operator<(const EnumLookup<EnumType, cs> &e1, const EnumLookup<EnumType, cs> &e2)
{
-#ifdef QTBUG_69389_FIXED
return e1.name.compare(e2.name, cs) < 0;
-#else
- return QtPrivate::compareStrings(e1.name, e2.name, cs) < 0;
-#endif
}
// Helper macros to define lookup functions that take a QStringView needle
@@ -3142,7 +3134,7 @@ AddedFunction::TypeInfo AddedFunction::TypeInfo::fromSignature(const QString& si
ComplexTypeEntry::ComplexTypeEntry(const QString &name, TypeEntry::Type t,
const QVersionNumber &vr) :
- TypeEntry(QString(name).replace(QLatin1String(".*::"), QString()), t, vr),
+ TypeEntry(name, t, vr),
m_qualifiedCppName(name),
m_qobject(false),
m_polymorphicBase(false),