summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/doc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/qdoc/doc.cpp')
-rw-r--r--src/tools/qdoc/doc.cpp43
1 files changed, 21 insertions, 22 deletions
diff --git a/src/tools/qdoc/doc.cpp b/src/tools/qdoc/doc.cpp
index 5a3ad959d2..c10e3b4669 100644
--- a/src/tools/qdoc/doc.cpp
+++ b/src/tools/qdoc/doc.cpp
@@ -1611,12 +1611,14 @@ void DocParser::parse(const QString& source,
QString word = in.mid(startPos, pos - startPos);
// is word a C++ symbol or an English word?
if ((numInternalUppercase >= 1 && numLowercase >= 2)
- || numStrangeSymbols >= 1) {
- append(Atom::AutoLink, word);
+ || numStrangeSymbols > 0) {
+ if (word.startsWith(QString("__")))
+ appendWord(word);
+ else
+ append(Atom::AutoLink, word);
}
- else {
+ else
appendWord(word);
- }
}
}
}
@@ -1690,12 +1692,15 @@ void DocParser::insertTarget(const QString &target, bool keyword)
}
else {
targetMap_.insert(target, location());
- append(Atom::Target, target);
priv->constructExtra();
- if (keyword)
+ if (keyword) {
+ append(Atom::Keyword, target);
priv->extra->keywords_.append(priv->text.lastAtom());
- else
+ }
+ else {
+ append(Atom::Target, target);
priv->extra->targets_.append(priv->text.lastAtom());
+ }
}
}
@@ -1991,7 +1996,7 @@ void DocParser::append(const QString &string)
Atom::Type lastType = priv->text.lastAtom()->type();
if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n")))
priv->text.lastAtom()->chopString();
- priv->text << Atom(string);
+ priv->text << Atom(string); // The Atom type is Link.
}
void DocParser::append(Atom::Type type, const QString& p1, const QString& p2)
@@ -2008,7 +2013,7 @@ void DocParser::append(const QString& p1, const QString& p2)
if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n")))
priv->text.lastAtom()->chopString();
if (p2.isEmpty())
- priv->text << Atom(p1);
+ priv->text << Atom(p1); // The Atom type is Link.
else
priv->text << LinkAtom(p1, p2);
}
@@ -2319,7 +2324,10 @@ QString DocParser::getBracedArgument(bool verbatim)
}
break;
default:
- arg += in[pos];
+ if (in[pos].isSpace() && !verbatim)
+ arg += QChar(' ');
+ else
+ arg += in[pos];
pos++;
}
}
@@ -2816,18 +2824,6 @@ QString DocParser::slashed(const QString& str)
#define COMMAND_BRIEF Doc::alias("brief")
#define COMMAND_QMLBRIEF Doc::alias("qmlbrief")
-#if 0
-Doc::Doc(const Location& start_loc,
- const Location& end_loc,
- const QString& source,
- const QSet<QString>& metaCommandSet)
-{
- priv = new DocPrivate(start_loc,end_loc,source);
- DocParser parser;
- parser.parse(source,priv,metaCommandSet,QSet<QString>());
-}
-#endif
-
/*!
Parse the qdoc comment \a source. Build up a list of all the topic
commands found including their arguments. This constructor is used
@@ -3234,6 +3230,9 @@ void Doc::initialize(const Config& config)
}
}
+/*!
+ All the heap allocated variables are deleted.
+ */
void Doc::terminate()
{
DocParser::exampleFiles.clear();