diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2009-12-07 05:20:47 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2009-12-07 05:20:47 (GMT) |
commit | 319e6ca83d82a765e499d796b78c3edf27a92bbe (patch) | |
tree | c7dfb42a84295438ef163e4975f6af2d88f649cc /tools/qdoc3/cppcodeparser.cpp | |
parent | 0a52079f104d806fab2a5f9dd0e176f3c33d704b (diff) | |
parent | 291a26abae4b7e1e4b77baf42964ccb77edf4adf (diff) | |
download | Qt-319e6ca83d82a765e499d796b78c3edf27a92bbe.zip Qt-319e6ca83d82a765e499d796b78c3edf27a92bbe.tar.gz Qt-319e6ca83d82a765e499d796b78c3edf27a92bbe.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into qt-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
doc: Example page now lists images used by the example
Fix compilation with Sun CC 5.9: it was crashing with this code.
Apparently fixes some build issues on some old unixes...
Fixed compile for S60.
Fix for virtual keyboard poping up when it should not.
Added a placeholderText(*) property to QLineEdit.
Fixes: OCI QSqlDatabase.tables() does not work with system tables.
really fix mingw+msys
less bizarre code; fix minor mistakes
compile fix for Qt in namespace
Assistant: Fix race condition in CLucene indexer.
remove unused line of code
Fixed QSqlRelationalTableModel doesn't correctly work with relation in other database schema
fix for mingw+msys
Fix a documentation typo.
QVector: fix const_iterator-=(int)
Diffstat (limited to 'tools/qdoc3/cppcodeparser.cpp')
-rw-r--r-- | tools/qdoc3/cppcodeparser.cpp | 67 |
1 files changed, 65 insertions, 2 deletions
diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index ce71e51..41a2456 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -197,8 +197,14 @@ CppCodeParser::CppCodeParser() */ CppCodeParser::~CppCodeParser() { + // nothing. } +/*! + The constructor initializes a map of special node types + for identifying important nodes. And it initializes + some filters for identifying certain kinds of files. + */ void CppCodeParser::initializeParser(const Config &config) { CodeParser::initializeParser(config); @@ -220,24 +226,46 @@ void CppCodeParser::initializeParser(const Config &config) exampleNameFilter = exampleFilePatterns.join(" "); else exampleNameFilter = "*.cpp *.h *.js *.xq *.svg *.xml *.ui"; + + QStringList exampleImagePatterns = config.getStringList( + CONFIG_EXAMPLES + Config::dot + CONFIG_IMAGEEXTENSIONS); + + if (!exampleImagePatterns.isEmpty()) + exampleImageFilter = exampleImagePatterns.join(" "); + else + exampleImageFilter = "*.png"; } +/*! + Clear the map of common node types and call + the same function in the base class. + */ void CppCodeParser::terminateParser() { nodeTypeMap.clear(); CodeParser::terminateParser(); } +/*! + Returns "Cpp". + */ QString CppCodeParser::language() { return "Cpp"; } +/*! + Returns a list of extensions for header files. + */ QString CppCodeParser::headerFileNameFilter() { return "*.ch *.h *.h++ *.hh *.hpp *.hxx"; } +/*! + Returns a list of extensions for source files, i.e. not + header files. + */ QString CppCodeParser::sourceFileNameFilter() { return "*.c++ *.cc *.cpp *.cxx"; @@ -299,6 +327,12 @@ void CppCodeParser::parseSourceFile(const Location& location, fclose(in); } +/*! + This is called after all the header files have been parsed. + I think the most important thing it does is resolve class + inheritance links in the tree. But it also initializes a + bunch of stuff. + */ void CppCodeParser::doneParsingHeaderFiles(Tree *tree) { tree->resolveInheritance(); @@ -345,6 +379,12 @@ void CppCodeParser::doneParsingHeaderFiles(Tree *tree) mutableAssociativeIteratorClasses.clear(); } +/*! + This is called after all the source files (i.e., not the + header files) have been parsed. It traverses the tree to + resolve property links, normalize overload signatures, and + do other housekeeping of the tree. + */ void CppCodeParser::doneParsingSourceFiles(Tree *tree) { tree->root()->makeUndocumentedChildrenInternal(); @@ -353,6 +393,13 @@ void CppCodeParser::doneParsingSourceFiles(Tree *tree) tree->resolveProperties(); } +/*! + This function searches the \a tree to find a FunctionNode + for a function with the signature \a synopsis. If the + \a relative node is provided, the search begins there. If + \a fuzzy is true, base classes are searched. The function + node is returned, if found. + */ const FunctionNode *CppCodeParser::findFunctionNode(const QString& synopsis, Tree *tree, Node *relative, @@ -2212,6 +2259,7 @@ void CppCodeParser::createExampleFileNodes(FakeNode *fake) exampleDirs, proFileName, userFriendlyFilePath); + if (fullPath.isEmpty()) { QString tmp = proFileName; proFileName = examplePath + "/" + "qbuild.pro"; @@ -2231,8 +2279,18 @@ void CppCodeParser::createExampleFileNodes(FakeNode *fake) int sizeOfBoringPartOfName = fullPath.size() - proFileName.size(); fullPath.truncate(fullPath.lastIndexOf('/')); - QStringList exampleFiles = Config::getFilesHere(fullPath, - exampleNameFilter); + QStringList exampleFiles = Config::getFilesHere(fullPath,exampleNameFilter); + QString imagesPath = fullPath + "/images"; + QStringList imageFiles = Config::getFilesHere(imagesPath,exampleImageFilter); + +#if 0 + qDebug() << "examplePath:" << examplePath; + qDebug() << " exampleFiles" << exampleFiles; + qDebug() << "imagesPath:" << imagesPath; + qDebug() << "fullPath:" << fullPath; + qDebug() << " imageFiles" << imageFiles; +#endif + if (!exampleFiles.isEmpty()) { // move main.cpp and to the end, if it exists QString mainCpp; @@ -2259,6 +2317,11 @@ void CppCodeParser::createExampleFileNodes(FakeNode *fake) (void) new FakeNode(fake, exampleFile.mid(sizeOfBoringPartOfName), Node::File); + foreach (const QString &imageFile, imageFiles) { + FakeNode* newFake = new FakeNode(fake, + imageFile.mid(sizeOfBoringPartOfName), + Node::Image); + } } QT_END_NAMESPACE |