summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMartin Smith <msmith@trolltech.com>2009-07-29 09:29:00 (GMT)
committerMartin Smith <msmith@trolltech.com>2009-07-29 09:29:48 (GMT)
commit0a0ec6b7b36e30a3165ad5400cf8999b344baa20 (patch)
treea0b9a9eaf63c183cd681bd5c6694d958f4f97607 /tools
parent953e8ed41dc0bc8490cbee4ab3068a03467b4f64 (diff)
downloadQt-0a0ec6b7b36e30a3165ad5400cf8999b344baa20.zip
Qt-0a0ec6b7b36e30a3165ad5400cf8999b344baa20.tar.gz
Qt-0a0ec6b7b36e30a3165ad5400cf8999b344baa20.tar.bz2
qdoc: Added -obsoletelinks flag to opt in for reporting obsolete links.
Diffstat (limited to 'tools')
-rw-r--r--tools/qdoc3/config.h1
-rw-r--r--tools/qdoc3/htmlgenerator.cpp11
-rw-r--r--tools/qdoc3/htmlgenerator.h1
-rw-r--r--tools/qdoc3/main.cpp10
4 files changed, 18 insertions, 5 deletions
diff --git a/tools/qdoc3/config.h b/tools/qdoc3/config.h
index 4e97d9f..22cb671 100644
--- a/tools/qdoc3/config.h
+++ b/tools/qdoc3/config.h
@@ -140,6 +140,7 @@ class Config
#define CONFIG_INDEXES "indexes"
#define CONFIG_LANGUAGE "language"
#define CONFIG_MACRO "macro"
+#define CONFIG_OBSOLETELINKS "obsoletelinks"
#define CONFIG_OUTPUTDIR "outputdir"
#define CONFIG_OUTPUTLANGUAGE "outputlanguage"
#define CONFIG_OUTPUTFORMATS "outputformats"
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index f92391e..68cad18 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -186,7 +186,7 @@ HtmlGenerator::HtmlGenerator()
: helpProjectWriter(0), inLink(false), inContents(false),
inSectionHeading(false), inTableHeader(false), numTableRows(0),
threeColumnEnumValueTable(true), funcLeftParen("\\S(\\()"),
- tre(0), slow(false)
+ tre(0), slow(false), obsoleteLinks(false)
{
}
@@ -215,6 +215,7 @@ void HtmlGenerator::initializeGenerator(const Config &config)
};
Generator::initializeGenerator(config);
+ obsoleteLinks = config.getBool(QLatin1String(CONFIG_OBSOLETELINKS));
setImageFileExtensions(QStringList() << "png" << "jpg" << "jpeg" << "gif");
int i = 0;
while (defaults[i].key) {
@@ -3534,9 +3535,11 @@ QString HtmlGenerator::getLink(const Atom *atom,
}
QString name = marker->plainFullName(relative);
if (!porting && !name.startsWith("Q3")) {
- relative->doc().location().warning(tr("Link to obsolete item '%1' in %2")
- .arg(atom->string())
- .arg(name));
+ if (obsoleteLinks) {
+ relative->doc().location().warning(tr("Link to obsolete item '%1' in %2")
+ .arg(atom->string())
+ .arg(name));
+ }
inObsoleteLink = true;
}
#if 0
diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h
index a7632cd..2ad4697 100644
--- a/tools/qdoc3/htmlgenerator.h
+++ b/tools/qdoc3/htmlgenerator.h
@@ -252,6 +252,7 @@ class HtmlGenerator : public PageGenerator
QStringList customHeadElements;
const Tree *tre;
bool slow;
+ bool obsoleteLinks;
QMap<QString, QMap<QString, const Node *> > moduleClassMap;
QMap<QString, QMap<QString, const Node *> > moduleNamespaceMap;
QMap<QString, const Node *> nonCompatClasses;
diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp
index 6425765..9338203 100644
--- a/tools/qdoc3/main.cpp
+++ b/tools/qdoc3/main.cpp
@@ -96,6 +96,7 @@ static const struct {
static bool slow = false;
static bool showInternal = false;
+static bool obsoleteLinks = false;
static QStringList defines;
static QHash<QString, Tree *> trees;
@@ -130,7 +131,9 @@ static void printHelp()
" -slow "
"Turn on features that slow down qdoc\n"
" -showinternal "
- "Include stuff marked internal") );
+ "Include stuff marked internal\n"
+ " -obsoletelinks "
+ "Report links from obsolete items to non-obsolete items") );
}
/*!
@@ -165,6 +168,8 @@ static void processQdocconfFile(const QString &fileName)
config.setStringList(CONFIG_SLOW, QStringList(slow ? "true" : "false"));
config.setStringList(CONFIG_SHOWINTERNAL,
QStringList(showInternal ? "true" : "false"));
+ config.setStringList(CONFIG_OBSOLETELINKS,
+ QStringList(obsoleteLinks ? "true" : "false"));
/*
With the default configuration values in place, load
@@ -434,6 +439,9 @@ int main(int argc, char **argv)
else if (opt == "-showinternal") {
showInternal = true;
}
+ else if (opt == "-obsoletelinks") {
+ obsoleteLinks = true;
+ }
else {
qdocFiles.append(opt);
}