From bfd065a98865ad1fafeacc8a4a140fecd73ddd38 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 13 Jul 2018 11:06:39 +0200 Subject: shiboken: Make revision and SBK index a member of TypeEntry They were previously stored in a global hash, apparently due to BC issues. Replace the global set/getTypeIndex/Revision functions by member functions of TypeEntry in typedatabase.cpp. As a drive-by change, simplify the code assigning the SBK numbers to use a flat list of entries ordered by revision and name instead of a grouped hash (bearing in mind that revision is rarely used) and might be removed one day). Also replace the use of std::unique() by the !contains()/append() pattern since std::unique() assumes an ordered list which is likely not the case. Task-number: PYSIDE-725 Task-number: PYSIDE-743 Change-Id: I9356acf1f5795446c08f266c1323f1db65cd490c Reviewed-by: Christian Tismer --- sources/shiboken2/ApiExtractor/typesystem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sources/shiboken2/ApiExtractor/typesystem.cpp') diff --git a/sources/shiboken2/ApiExtractor/typesystem.cpp b/sources/shiboken2/ApiExtractor/typesystem.cpp index 511b67ec8..41d08cb34 100644 --- a/sources/shiboken2/ApiExtractor/typesystem.cpp +++ b/sources/shiboken2/ApiExtractor/typesystem.cpp @@ -642,7 +642,7 @@ void Handler::addFlags(const QString &name, QString flagName, QString revision = attributes.value(QLatin1String("flags-revision")); if (revision.isEmpty()) revision = attributes.value(QLatin1String("revision")); - setTypeRevision(ftype, revision.toInt()); + ftype->setRevision(revision.toInt()); } bool Handler::handleSmartPointerEntry(StackElement *element, @@ -1098,7 +1098,7 @@ bool Handler::startElement(const QStringRef &n, const QXmlStreamAttributes &atts if (element->entry) { m_database->addType(element->entry); - setTypeRevision(element->entry, attributes[QLatin1String("revision")].toInt()); + element->entry->setRevision(attributes.value(QLatin1String("revision")).toInt()); } else { qCWarning(lcShiboken).noquote().nospace() << QStringLiteral("Type: %1 was rejected by typesystem").arg(name); -- cgit v1.2.3