summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-07-29 09:38:37 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-07-29 09:38:37 (GMT)
commit0faf8aac7bb5fce974ae145a62b497dd57ecb1f3 (patch)
tree5e2cb640448f86021760a022dca3b42f331c2557 /tools/qdoc3
parent55d72c2ffc857da3bdec78544d6f3d90dca19c7f (diff)
parent0a0ec6b7b36e30a3165ad5400cf8999b344baa20 (diff)
downloadQt-0faf8aac7bb5fce974ae145a62b497dd57ecb1f3.zip
Qt-0faf8aac7bb5fce974ae145a62b497dd57ecb1f3.tar.gz
Qt-0faf8aac7bb5fce974ae145a62b497dd57ecb1f3.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'tools/qdoc3')
-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);
}