diff options
author | Topi Reinio <topi.reinio@qt.io> | 2017-07-03 15:48:50 +0200 |
---|---|---|
committer | Topi Reiniƶ <topi.reinio@qt.io> | 2017-07-04 08:36:07 +0000 |
commit | f74df71c48e5878de8eb44ee107aeed42385eff6 (patch) | |
tree | c27df82cffe34e767d7595bd12728f42cb2045cd /src/qdoc/cppcodeparser.cpp | |
parent | ebb7a33ed90264a6b82c7978b58ce71b5c7cf042 (diff) | |
download | qttools-f74df71c48e5878de8eb44ee107aeed42385eff6.tar.gz |
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 <martin.smith@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Diffstat (limited to 'src/qdoc/cppcodeparser.cpp')
-rw-r--r-- | src/qdoc/cppcodeparser.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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<QString> 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; |