summaryrefslogtreecommitdiff
path: root/src/qdoc/cppcodeparser.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-05-27 15:09:10 +0200
committerLiang Qi <liang.qi@qt.io>2016-05-27 15:09:10 +0200
commit5a4ff3a262db3ae31993e9fa596c1b5a00359204 (patch)
tree1c7fba555e8a00a60bdfb93599681cc78ee6bb3c /src/qdoc/cppcodeparser.cpp
parent5b35c21437054148e867253f1ca2d740d465d047 (diff)
parent1d0a02f8a227286dbc383f890a1fd61e9139c223 (diff)
downloadqttools-5a4ff3a262db3ae31993e9fa596c1b5a00359204.tar.gz
Merge remote-tracking branch 'origin/5.7' into dev
Change-Id: I3994e80ec7366f1303d23214315013b79ca2acf3
Diffstat (limited to 'src/qdoc/cppcodeparser.cpp')
-rw-r--r--src/qdoc/cppcodeparser.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp
index c1295c3a7..61fb9b7d7 100644
--- a/src/qdoc/cppcodeparser.cpp
+++ b/src/qdoc/cppcodeparser.cpp
@@ -54,6 +54,8 @@ static bool inMacroCommand_ = false;
static bool parsingHeaderFile_ = false;
QStringList CppCodeParser::exampleFiles;
QStringList CppCodeParser::exampleDirs;
+QSet<QString> CppCodeParser::excludeDirs;
+QSet<QString> CppCodeParser::excludeFiles;
CppCodeParser* CppCodeParser::cppParser_ = 0;
/*!
@@ -78,7 +80,7 @@ CppCodeParser::~CppCodeParser()
/*!
The constructor initializes a map of special node types
for identifying important nodes. And it initializes
- some filters for identifying certain kinds of files.
+ some filters for identifying and excluding certain kinds of files.
*/
void CppCodeParser::initializeParser(const Config &config)
{
@@ -100,6 +102,10 @@ void CppCodeParser::initializeParser(const Config &config)
QStringList exampleFilePatterns = config.getStringList(
CONFIG_EXAMPLES + Config::dot + CONFIG_FILEEXTENSIONS);
+ // Used for excluding dirs and files from the list of example files
+ excludeDirs = QSet<QString>::fromList(config.getCanonicalPathList(CONFIG_EXCLUDEDIRS));
+ excludeFiles = QSet<QString>::fromList(config.getCanonicalPathList(CONFIG_EXCLUDEFILES));
+
if (!exampleFilePatterns.isEmpty())
exampleNameFilter = exampleFilePatterns.join(' ');
else
@@ -121,6 +127,8 @@ void CppCodeParser::initializeParser(const Config &config)
void CppCodeParser::terminateParser()
{
nodeTypeMap.clear();
+ excludeDirs.clear();
+ excludeFiles.clear();
CodeParser::terminateParser();
}
@@ -2643,9 +2651,9 @@ void CppCodeParser::createExampleFileNodes(DocumentNode *dn)
sizeOfBoringPartOfName = sizeOfBoringPartOfName - 2;
fullPath.truncate(fullPath.lastIndexOf('/'));
- QStringList exampleFiles = Config::getFilesHere(fullPath,exampleNameFilter);
+ QStringList exampleFiles = Config::getFilesHere(fullPath, exampleNameFilter, Location(), excludeDirs, excludeFiles);
QString imagesPath = fullPath + "/images";
- QStringList imageFiles = Config::getFilesHere(imagesPath,exampleImageFilter);
+ QStringList imageFiles = Config::getFilesHere(imagesPath, exampleImageFilter, Location(), excludeDirs, excludeFiles);
if (!exampleFiles.isEmpty()) {
// move main.cpp and to the end, if it exists
QString mainCpp;