From e4e1027d382eef3552ebb4c6ec6bc94ecb4068c0 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 14 Sep 2017 09:59:27 +0200 Subject: 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 --- sources/shiboken2/ApiExtractor/typesystem.cpp | 5 +++-- 1 file changed, 3 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 6ba609333..9c80a6c0b 100644 --- a/sources/shiboken2/ApiExtractor/typesystem.cpp +++ b/sources/shiboken2/ApiExtractor/typesystem.cpp @@ -1947,8 +1947,9 @@ bool Handler::startElement(const QStringRef &n, const QXmlStreamAttributes &atts if (m_generate != TypeEntry::GenerateForSubclass && m_generate != TypeEntry::GenerateNothing && !file_name.isEmpty()) { - if (QFile::exists(file_name)) { - QFile codeFile(file_name); + const QString resolved = m_database->modifiedTypesystemFilepath(file_name, false); + if (QFile::exists(resolved)) { + QFile codeFile(resolved); if (codeFile.open(QIODevice::Text | QIODevice::ReadOnly)) { QString content = QLatin1String("// ========================================================================\n" "// START of custom code block [file: "); -- cgit v1.2.3