From f74df71c48e5878de8eb44ee107aeed42385eff6 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Mon, 3 Jul 2017 15:48:50 +0200 Subject: qdoc: Further improve example file listing Fix a bug where '\generatelist examplefiles' with no second parameter produced an empty list, instead of listing all files. Also, no longer restrict the searching of example image files to the images/ subdirectory. All images under a project directory are now listed, except those under doc/images. Minor fixes to related QDoc documentation. Change-Id: Id4516ba2feb98466a0e893a85f85118e3d21eae2 Reviewed-by: Martin Smith Reviewed-by: Venugopal Shivashankar --- src/qdoc/cppcodeparser.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/qdoc/cppcodeparser.cpp') diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp index a819026d8..7298d1ec2 100644 --- a/src/qdoc/cppcodeparser.cpp +++ b/src/qdoc/cppcodeparser.cpp @@ -2651,8 +2651,10 @@ void CppCodeParser::createExampleFileNodes(DocumentNode *dn) fullPath.truncate(fullPath.lastIndexOf('/')); QStringList exampleFiles = Config::getFilesHere(fullPath, exampleNameFilter, Location(), excludeDirs, excludeFiles); - QString imagesPath = fullPath + "/images"; - QStringList imageFiles = Config::getFilesHere(imagesPath, exampleImageFilter, Location(), excludeDirs, excludeFiles); + // Search for all image files under the example project, excluding doc/images directory. + QSet excludeDocDirs(excludeDirs); + excludeDocDirs.insert(QDir(fullPath).canonicalPath() + "/doc/images"); + QStringList imageFiles = Config::getFilesHere(fullPath, exampleImageFilter, Location(), excludeDocDirs, excludeFiles); if (!exampleFiles.isEmpty()) { // move main.cpp and to the end, if it exists QString mainCpp; -- cgit v1.2.1