From 739e404eee420257f217001c5df753585b8a9031 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Fri, 27 Mar 2020 12:58:49 +0100 Subject: qdoc: Fix regression in resolved example file paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A recent refactoring of code related to generation of example file lists caused a regression; if the parameter passed to an \example command contained subdirectories, e.g. \example tutorials/gettingstarted only the immediate example directory ('gettingstarted' above) was recorded in generated example lists and manifest files. Ensure that the file paths are prefixed with the full example location, and add a test to cover this. Fixes: QTBUG-83130 Change-Id: I061dcf6cd4e94a2c65e5a50a39f379759d7cd06f Reviewed-by: Topi Reiniƶ --- src/qdoc/cppcodeparser.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/qdoc/cppcodeparser.cpp') diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp index 065032024..5248c990d 100644 --- a/src/qdoc/cppcodeparser.cpp +++ b/src/qdoc/cppcodeparser.cpp @@ -813,8 +813,7 @@ void CppCodeParser::setExampleFileLists(ExampleNode *en) QLatin1String("*.qrc *.pro *.qmlproject *.pyproject CMakeLists.txt qmldir")); } - exampleDir.cdUp(); - int pathLen = exampleDir.path().size() + 1; + const int pathLen = exampleDir.path().size() - en->name().size(); for (auto &file : exampleFiles) file = file.mid(pathLen); for (auto &file : imageFiles) -- cgit v1.2.1