summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2011-01-20 17:39:20 (GMT)
committerDavid Boddie <david.boddie@nokia.com>2011-01-20 17:39:20 (GMT)
commit92e0bfee7efb1505dbff6860f925445214fc7a54 (patch)
tree0e08b39a35ac9f49f0c0de200238d74189e25da7
parente7e95bf64a4e513dd423acc38be615501ef76eac (diff)
downloadQt-92e0bfee7efb1505dbff6860f925445214fc7a54.zip
Qt-92e0bfee7efb1505dbff6860f925445214fc7a54.tar.gz
Qt-92e0bfee7efb1505dbff6860f925445214fc7a54.tar.bz2
Enabled syntax highlighting by default.
Removed the linksinmarkup configuration option because it was not introduced in all relevant places.
-rw-r--r--tools/qdoc3/codemarker.cpp8
-rw-r--r--tools/qdoc3/codemarker.h2
-rw-r--r--tools/qdoc3/config.h1
-rw-r--r--tools/qdoc3/htmlgenerator.cpp42
-rw-r--r--tools/qdoc3/htmlgenerator.h1
-rw-r--r--tools/qdoc3/main.cpp1
6 files changed, 20 insertions, 35 deletions
diff --git a/tools/qdoc3/codemarker.cpp b/tools/qdoc3/codemarker.cpp
index 89933d3..9047b6e 100644
--- a/tools/qdoc3/codemarker.cpp
+++ b/tools/qdoc3/codemarker.cpp
@@ -59,7 +59,6 @@ QList<CodeMarker *> CodeMarker::markers;
been read.
*/
CodeMarker::CodeMarker()
- : linksInMarkup(false)
{
markers.prepend(this);
}
@@ -74,14 +73,11 @@ CodeMarker::~CodeMarker()
}
/*!
- The only thing a code market initializes is its \e{linksInMarkup}
- flag. The \e{linksInMarkup} flag indicates whether links are created for
- names that have corresponding entries in the API documentation.
- It is turned off by default.
+ A code market performs no initialization by default. Marker-specific
+ initialization is performed in subclasses.
*/
void CodeMarker::initializeMarker(const Config &config)
{
- linksInMarkup = config.getBool(QLatin1String(CONFIG_LINKSINMARKUP));
}
/*!
diff --git a/tools/qdoc3/codemarker.h b/tools/qdoc3/codemarker.h
index 6c45581..ed44395 100644
--- a/tools/qdoc3/codemarker.h
+++ b/tools/qdoc3/codemarker.h
@@ -184,8 +184,6 @@ class CodeMarker
private:
QString macName(const Node *parent, const QString &name = QString());
- bool linksInMarkup;
-
static QString defaultLang;
static QList<CodeMarker *> markers;
};
diff --git a/tools/qdoc3/config.h b/tools/qdoc3/config.h
index 2dd7d50..54c7dab 100644
--- a/tools/qdoc3/config.h
+++ b/tools/qdoc3/config.h
@@ -141,7 +141,6 @@ class Config
#define CONFIG_IMAGES "images"
#define CONFIG_INDEXES "indexes"
#define CONFIG_LANGUAGE "language"
-#define CONFIG_LINKSINMARKUP "linksinmarkup"
#define CONFIG_MACRO "macro"
#define CONFIG_NATURALLANGUAGE "naturallanguage"
#define CONFIG_OBSOLETELINKS "obsoletelinks"
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 4385dfd..10802b2 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -219,7 +219,6 @@ HtmlGenerator::HtmlGenerator()
threeColumnEnumValueTable(true),
funcLeftParen("\\S(\\()"),
myTree(0),
- syntaxHighlighting(false),
obsoleteLinks(false)
{
}
@@ -320,8 +319,6 @@ void HtmlGenerator::initializeGenerator(const Config &config)
++edition;
}
- syntaxHighlighting = config.getBool(CONFIG_SYNTAXHIGHLIGHTING);
-
codeIndent = config.getInt(CONFIG_CODEINDENT);
helpProjectWriter = new HelpProjectWriter(config,
@@ -2790,31 +2787,28 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode,
}
- if (syntaxHighlighting) {
- // is this block ever used at all?
- // replace all <@func> tags: "(<@func target=\"([^\"]*)\">)(.*)(</@func>)"
- src = html;
- html = QString();
- for (int i = 0, srcSize = src.size(); i < srcSize;) {
- if (src.at(i) == charLangle && src.at(i + 1) == charAt) {
- i += 2;
- if (parseArg(src, funcTag, &i, srcSize, &arg, &par1)) {
- const Node* n = marker->resolveTarget(par1.toString(),
- myTree,
- relative);
- QString link = linkForNode(n, relative);
- addLink(link, arg, &html);
- par1 = QStringRef();
- }
- else {
- html += charLangle;
- html += charAt;
- }
+ // replace all <@func> tags: "(<@func target=\"([^\"]*)\">)(.*)(</@func>)"
+ src = html;
+ html = QString();
+ for (int i = 0, srcSize = src.size(); i < srcSize;) {
+ if (src.at(i) == charLangle && src.at(i + 1) == charAt) {
+ i += 2;
+ if (parseArg(src, funcTag, &i, srcSize, &arg, &par1)) {
+ const Node* n = marker->resolveTarget(par1.toString(),
+ myTree,
+ relative);
+ QString link = linkForNode(n, relative);
+ addLink(link, arg, &html);
+ par1 = QStringRef();
}
else {
- html += src.at(i++);
+ html += charLangle;
+ html += charAt;
}
}
+ else {
+ html += src.at(i++);
+ }
}
// replace all "(<@(type|headerfile|func)(?: +[^>]*)?>)(.*)(</@\\2>)" tags
diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h
index 6701184..500780f 100644
--- a/tools/qdoc3/htmlgenerator.h
+++ b/tools/qdoc3/htmlgenerator.h
@@ -279,7 +279,6 @@ class HtmlGenerator : public PageGenerator
QStringList stylesheets;
QStringList customHeadElements;
const Tree *myTree;
- bool syntaxHighlighting;
bool obsoleteLinks;
QMap<QString, NodeMap > moduleClassMap;
QMap<QString, NodeMap > moduleNamespaceMap;
diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp
index 8193d2d..5b50a2a 100644
--- a/tools/qdoc3/main.cpp
+++ b/tools/qdoc3/main.cpp
@@ -148,7 +148,6 @@ static void processQdocconfFile(const QString &fileName)
++i;
}
config.setStringList(CONFIG_SYNTAXHIGHLIGHTING, QStringList(slow ? "true" : "false"));
- config.setStringList(CONFIG_LINKSINMARKUP, QStringList(slow ? "true" : "false"));
config.setStringList(CONFIG_SHOWINTERNAL,
QStringList(showInternal ? "true" : "false"));
config.setStringList(CONFIG_OBSOLETELINKS,