diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-07-13 11:06:39 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-07-13 12:22:35 +0000 |
commit | bfd065a98865ad1fafeacc8a4a140fecd73ddd38 (patch) | |
tree | 13f122e037ec7acdace6e91f6813b23ae706c812 /sources/shiboken2/ApiExtractor/typesystem.h | |
parent | 817652ee47bb2fc68734f8ef13417d4546978a42 (diff) |
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 <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/typesystem.h')
-rw-r--r-- | sources/shiboken2/ApiExtractor/typesystem.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/typesystem.h b/sources/shiboken2/ApiExtractor/typesystem.h index 4b937faa6..dd4f39e7a 100644 --- a/sources/shiboken2/ApiExtractor/typesystem.h +++ b/sources/shiboken2/ApiExtractor/typesystem.h @@ -715,6 +715,11 @@ public: && m_codeGeneration != TypeEntry::GenerateNothing; } + int revision() const { return m_revision; } + void setRevision(int r); // see typedatabase.cpp + int sbkIndex() const; + void setSbkIndex(int i) { m_sbkIndex = i; } + virtual QString qualifiedCppName() const { return m_name; @@ -904,6 +909,8 @@ private: bool m_stream = false; QVersionNumber m_version; CustomConversion *m_customConversion = nullptr; + int m_revision = 0; + int m_sbkIndex = 0; }; class TypeSystemTypeEntry : public TypeEntry |