summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@digia.com>2014-08-26 11:54:17 +0200
committerTopi Reiniƶ <topi.reinio@digia.com>2014-08-29 00:22:03 +0200
commite4a778d9c261b6707cd9a3c4c174d8809a1cf9d3 (patch)
tree1b96aca23539b10747d97a5dd444c79e66e54ea7 /src/tools
parent1b32e8d7d488e0d0b96d6d39117ff41014791105 (diff)
qdoc: Use qdoc error logging for warnings related to index files
Make the warnings that are displayed during the reading of index files and dependencies more consistent by using QDoc's error logging functions. This means that warnings are not generated in prepare phase, but they are generated for projects that call qdoc directly, running prepare and generate phases in one go. Change-Id: I645c3feb1cbf471fd3ca6034f94e7dc1ea35b875 Reviewed-by: Martin Smith <martin.smith@digia.com>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/qdoc/main.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp
index 758918e2b6..083f54104d 100644
--- a/src/tools/qdoc/main.cpp
+++ b/src/tools/qdoc/main.cpp
@@ -49,6 +49,7 @@
#include "ditaxmlgenerator.h"
#include "doc.h"
#include "htmlgenerator.h"
+#include "location.h"
#include "plaincodemarker.h"
#include "puredocparser.h"
#include "tokenizer.h"
@@ -101,8 +102,8 @@ static void loadIndexFiles(Config& config)
QFileInfo fi(index);
if (fi.exists() && fi.isFile())
indexFiles << index;
- else if (Generator::runGenerateOnly())
- qDebug() << "warning: Index file not found:" << index;
+ else
+ Location::null.warning(QString("Index file not found: %1").arg(index));
}
dependModules += config.getStringList(CONFIG_DEPENDS);
@@ -165,11 +166,14 @@ static void loadIndexFiles(Config& config)
multiple index files for a module, since the last modified file has the
highest UNIX timestamp.
*/
- qDebug() << "Multiple indices found for dependency:" << dependModules[i] << "\nFound:";
+ QStringList indexPaths;
for (int k = 0; k < foundIndices.size(); k++)
- qDebug() << foundIndices[k].absoluteFilePath();
- qDebug() << "Using" << foundIndices[foundIndices.size() - 1].absoluteFilePath()
- << "as index for" << dependModules[i];
+ indexPaths << foundIndices[k].absoluteFilePath();
+ Location::null.warning(QString("Multiple index files found for dependency \"%1\":\n%2").arg(
+ dependModules[i], indexPaths.join('\n')));
+ Location::null.warning(QString("Using %1 as index file for dependency \"%2\"").arg(
+ foundIndices[foundIndices.size() - 1].absoluteFilePath(),
+ dependModules[i]));
indexToAdd = foundIndices[foundIndices.size() - 1].absoluteFilePath();
}
else if (foundIndices.size() == 1) {
@@ -179,16 +183,14 @@ static void loadIndexFiles(Config& config)
if (!indexFiles.contains(indexToAdd))
indexFiles << indexToAdd;
}
- else if (Generator::runGenerateOnly()) {
- qDebug() << "warning:" << config.getString(CONFIG_PROJECT)
- << "Cannot locate index file for dependency"
- << dependModules[i];
+ else {
+ Location::null.warning(QString("\"%1\" Cannot locate index file for dependency \"%2\"").arg(
+ config.getString(CONFIG_PROJECT), dependModules[i]));
}
}
}
else {
- qDebug() << "Dependent modules specified, but no index directories were set."
- << "There will probably be errors for missing links.";
+ Location::null.warning(QLatin1String("Dependent modules specified, but no index directories were set. There will probably be errors for missing links."));
}
}
qdb->readIndexes(indexFiles);