From 14b07221664f95aea7603d6b7625c4467641b57c Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 11 Jun 2012 11:29:31 +0200 Subject: qdoc: Better error messages for QML command errors Some error messages were not clear for these qdoc commands: \qmlclass, \qmlmodule, \inqmlmodule, and \qmlproperty. They have been made clearer now. Also, qdoc now parses input files in the same order all the time now. The order is alphabetic now. This might not be the optimal order. Change-Id: Id53a5ec8105009c71f4bbd41973a54aed7821099 Reviewed-by: Casper van Donderen --- src/tools/qdoc/main.cpp | 50 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 11 deletions(-) (limited to 'src/tools/qdoc/main.cpp') diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp index 9e1e3cddd03..41d2f44a68a 100644 --- a/src/tools/qdoc/main.cpp +++ b/src/tools/qdoc/main.cpp @@ -319,8 +319,6 @@ static void processQdocconfFile(const QString &fileName) QSet excludedDirs; QSet excludedFiles; - QSet headers; - QSet sources; QStringList headerList; QStringList sourceList; QStringList excludedDirsList; @@ -339,23 +337,48 @@ static void processQdocconfFile(const QString &fileName) } headerList = config.getAllFiles(CONFIG_HEADERS,CONFIG_HEADERDIRS,excludedDirs,excludedFiles); - headers = QSet::fromList(headerList); + QMap headers; + for (int i=0; i::fromList(sourceList); - + QMap sources; + for (int i=0; iopen(QFile::WriteOnly); + QTextStream* filesout = new QTextStream(files); +#if 0 + { + QSet::ConstIterator i = headers.begin(); + while (i != headers.end()) { + //(*filesout) << (*i).mid((*i).lastIndexOf('/')+1) << "\n"; + ++i; + } + i = sources.begin(); + while (i != sources.end()) { + //(*filesout) << (*i).mid((*i).lastIndexOf('/')+1) << "\n"; + ++i; + } + } + //filesout->flush(); + //files->close(); +#endif /* Parse each header file in the set using the appropriate parser and add it to the big tree. */ QSet usedParsers; - QSet::ConstIterator h = headers.constBegin(); + int parsed = 0; + QMap::ConstIterator h = headers.constBegin(); while (h != headers.constEnd()) { - CodeParser *codeParser = CodeParser::parserForHeaderFile(*h); + CodeParser *codeParser = CodeParser::parserForHeaderFile(h.key()); if (codeParser) { - codeParser->parseHeaderFile(config.location(), *h, tree); + ++parsed; + codeParser->parseHeaderFile(config.location(), h.key(), tree); usedParsers.insert(codeParser); + (*filesout) << (h.key()).mid((h.key()).lastIndexOf('/')+1) << "\n"; } ++h; } @@ -368,15 +391,20 @@ static void processQdocconfFile(const QString &fileName) Parse each source text file in the set using the appropriate parser and add it to the big tree. */ - QSet::ConstIterator s = sources.constBegin(); + parsed = 0; + QMap::ConstIterator s = sources.constBegin(); while (s != sources.constEnd()) { - CodeParser *codeParser = CodeParser::parserForSourceFile(*s); + CodeParser *codeParser = CodeParser::parserForSourceFile(s.key()); if (codeParser) { - codeParser->parseSourceFile(config.location(), *s, tree); + ++parsed; + codeParser->parseSourceFile(config.location(), s.key(), tree); usedParsers.insert(codeParser); + (*filesout) << s.key().mid((s.key()).lastIndexOf('/')+1) << "\n"; } ++s; } + filesout->flush(); + files->close(); foreach (CodeParser *codeParser, usedParsers) codeParser->doneParsingSourceFiles(tree); -- cgit v1.2.3