From 009c7413952c01c7ba4722aa73c968e07dc17e04 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 4 Apr 2019 11:29:58 +0200 Subject: shiboken: Allow for include paths with relative directories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Cristian Maureira-Fredes --- sources/shiboken2/ApiExtractor/typesystem.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sources/shiboken2/ApiExtractor/typesystem.cpp') 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 &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()) -- cgit v1.2.3