diff options
author | Topi Reinio <topi.reinio@qt.io> | 2020-03-27 12:58:49 +0100 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2020-03-29 20:20:28 +0200 |
commit | 739e404eee420257f217001c5df753585b8a9031 (patch) | |
tree | 42d655ec93a81154a5a07ce46b099044622df870 /src | |
parent | 24b8e654a0d6485d447da54ba017a1eb9ec3f22d (diff) |
qdoc: Fix regression in resolved example file paths
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ƶ <topi.reinio@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/qdoc/cppcodeparser.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
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) |