diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-04-04 11:29:58 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-04-04 14:42:20 +0000 |
commit | 009c7413952c01c7ba4722aa73c968e07dc17e04 (patch) | |
tree | b172946d8d7011c3a95827d6c3f0f27b217e1b12 /sources/shiboken2/ApiExtractor/typesystem.cpp | |
parent | 7de80955ccb5383d07183c119b834d12cecedd0c (diff) |
shiboken: Allow for include paths with relative directories
Resolve the absolute file paths of the code model items against the
include paths of shiboken to reconstruct the relative paths.
Change-Id: Id0f793315b01c0fc65a4cfb26b3372f9c6688872
Fixes: PYSIDE-975
Reviewed-by: Volker Aßmann <volker.assmann@gmail.com>
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.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/typesystem.cpp b/sources/shiboken2/ApiExtractor/typesystem.cpp index ad97e40ee..3bb2f0efa 100644 --- a/sources/shiboken2/ApiExtractor/typesystem.cpp +++ b/sources/shiboken2/ApiExtractor/typesystem.cpp @@ -3483,6 +3483,20 @@ static const QSet<QString> &primitiveCppTypes() return result; } +void TypeEntry::setInclude(const Include &inc) +{ + // This is a workaround for preventing double inclusion of the QSharedPointer implementation + // header, which does not use header guards. In the previous parser this was not a problem + // because the Q_QDOC define was set, and the implementation header was never included. + if (inc.name().endsWith(QLatin1String("qsharedpointer_impl.h"))) { + QString path = inc.name(); + path.remove(QLatin1String("_impl")); + m_include = Include(inc.type(), path); + } else { + m_include = inc; + } +} + bool TypeEntry::isCppPrimitive() const { if (!isPrimitive()) |