diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-09-14 09:59:27 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-09-15 08:34:33 +0000 |
commit | e4e1027d382eef3552ebb4c6ec6bc94ecb4068c0 (patch) | |
tree | 35f743bd523d38afadd68655a96458110c110aac /sources/shiboken2/ApiExtractor/typedatabase.cpp | |
parent | 09d9cc162e89498d1e6424420ab288b4fba8ed6f (diff) |
Typesystem parser: Look up external injected code in typesystem path
Make TypeDatabase::modifiedTypesystemFilepath() public and
add parameter preventing it from stripping the path so that it
can handle 'glue/snippet.cpp' correctly.
This removes the need to run shiboken with the working directory set to the
type system file path in order to find the external injected code snippets
for documentation generation.
Task-number: PYSIDE-363
Change-Id: Ic61cc1d1187e326e5255b29759a9d42e27ebd8d4
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/typedatabase.cpp')
-rw-r--r-- | sources/shiboken2/ApiExtractor/typedatabase.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sources/shiboken2/ApiExtractor/typedatabase.cpp b/sources/shiboken2/ApiExtractor/typedatabase.cpp index be0d987a4..4a96240c4 100644 --- a/sources/shiboken2/ApiExtractor/typedatabase.cpp +++ b/sources/shiboken2/ApiExtractor/typedatabase.cpp @@ -451,14 +451,14 @@ bool TypeDatabase::isSuppressedWarning(const QString& s) const return false; } -QString TypeDatabase::modifiedTypesystemFilepath(const QString& tsFile) const +QString TypeDatabase::modifiedTypesystemFilepath(const QString& tsFile, bool stripPath) const { const QFileInfo tsFi(tsFile); if (tsFi.isAbsolute()) // No point in further lookups return tsFi.absoluteFilePath(); if (tsFi.isFile()) // Make path absolute return tsFi.absoluteFilePath(); - const QString fileName = tsFi.fileName(); + const QString fileName = stripPath ? tsFi.fileName() : tsFile; for (const QString &path : m_typesystemPaths) { const QFileInfo fi(path + QLatin1Char('/') + fileName); if (fi.isFile()) |