summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorTobias Koenig <tokoe@kde.org>2009-06-10 15:11:59 (GMT)
committerTobias Koenig <tokoe@kde.org>2009-06-10 15:11:59 (GMT)
commitf1e6e89f7ee452af0e4404af537f5fed2a2b2dc5 (patch)
tree045fbf67a4806e4e217ef23cdf4f363ac359bef1 /tools
parent5d87f2542bbcb0877f4a9a9b5be4df80cd6aa4cd (diff)
parent5b24c5793607c809b1bac82c7cc3696001ee9217 (diff)
downloadQt-f1e6e89f7ee452af0e4404af537f5fed2a2b2dc5.zip
Qt-f1e6e89f7ee452af0e4404af537f5fed2a2b2dc5.tar.gz
Qt-f1e6e89f7ee452af0e4404af537f5fed2a2b2dc5.tar.bz2
Merge branch 'master' of git://gitorious.org/qt/qt
Diffstat (limited to 'tools')
-rw-r--r--tools/assistant/lib/qhelpdbreader.cpp3
-rw-r--r--tools/linguist/lupdate/cpp.cpp27
-rw-r--r--tools/linguist/shared/numerus.cpp46
-rw-r--r--tools/qdoc3/htmlgenerator.cpp106
-rw-r--r--tools/qdoc3/htmlgenerator.h1
-rw-r--r--tools/qdoc3/qdoc3.pro4
-rw-r--r--tools/qdoc3/test/classic.css52
-rw-r--r--tools/qdoc3/tree.cpp80
8 files changed, 217 insertions, 102 deletions
diff --git a/tools/assistant/lib/qhelpdbreader.cpp b/tools/assistant/lib/qhelpdbreader.cpp
index 76994a7..27bc4d7 100644
--- a/tools/assistant/lib/qhelpdbreader.cpp
+++ b/tools/assistant/lib/qhelpdbreader.cpp
@@ -92,6 +92,9 @@ bool QHelpDBReader::init()
QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), m_uniqueId);
db.setDatabaseName(m_dbName);
if (!db.open()) {
+ /*: The placeholders are: %1 - The name of the database which cannot be opened
+ %2 - The unique id for the connection
+ %3 - The actual error string */
m_error = tr("Cannot open database '%1' '%2': %3").arg(m_dbName, m_uniqueId, db.lastError().text());
QSqlDatabase::removeDatabase(m_uniqueId);
return false;
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp
index 42aa2f0..b9e8406 100644
--- a/tools/linguist/lupdate/cpp.cpp
+++ b/tools/linguist/lupdate/cpp.cpp
@@ -145,7 +145,6 @@ public:
const ParseResults *getResults() const { return results; }
void deleteResults() { delete results; }
-private:
struct SavedState {
QStringList namespaces;
QStack<int> namespaceDepths;
@@ -154,6 +153,7 @@ private:
QString pendingContext;
};
+private:
struct IfdefState {
IfdefState() {}
IfdefState(int _braceDepth, int _parenDepth) :
@@ -319,12 +319,27 @@ uint CppParser::getChar()
if (yyInPos >= yyInStr.size())
return EOF;
uint c = yyInStr[yyInPos++].unicode();
- if (c == '\\' && yyInPos < yyInStr.size() && yyInStr[yyInPos].unicode() == '\n') {
- ++yyCurLineNo;
- ++yyInPos;
- continue;
+ if (c == '\\' && yyInPos < yyInStr.size()) {
+ if (yyInStr[yyInPos].unicode() == '\n') {
+ ++yyCurLineNo;
+ ++yyInPos;
+ continue;
+ }
+ if (yyInStr[yyInPos].unicode() == '\r') {
+ ++yyCurLineNo;
+ ++yyInPos;
+ if (yyInPos < yyInStr.size() && yyInStr[yyInPos].unicode() == '\n')
+ ++yyInPos;
+ continue;
+ }
}
- if (c == '\n') {
+ if (c == '\r') {
+ if (yyInPos < yyInStr.size() && yyInStr[yyInPos].unicode() == '\n')
+ ++yyInPos;
+ c = '\n';
+ ++yyCurLineNo;
+ yyAtNewline = true;
+ } else if (c == '\n') {
++yyCurLineNo;
yyAtNewline = true;
} else if (c != ' ' && c != '\t' && c != '#') {
diff --git a/tools/linguist/shared/numerus.cpp b/tools/linguist/shared/numerus.cpp
index f3a29cc..50e85cb 100644
--- a/tools/linguist/shared/numerus.cpp
+++ b/tools/linguist/shared/numerus.cpp
@@ -60,12 +60,11 @@ static const uchar frenchStyleRules[] =
static const uchar latvianRules[] =
{ Q_MOD_10 | Q_EQ, 1, Q_AND, Q_MOD_100 | Q_NEQ, 11, Q_NEWRULE,
Q_NEQ, 0 };
+static const uchar icelandicRules[] =
+ { Q_MOD_10 | Q_EQ, 1, Q_AND, Q_MOD_100 | Q_NEQ, 11 };
static const uchar irishStyleRules[] =
{ Q_EQ, 1, Q_NEWRULE,
Q_EQ, 2 };
-static const uchar czechRules[] =
- { Q_MOD_100 | Q_EQ, 1, Q_NEWRULE,
- Q_MOD_100 | Q_BETWEEN, 2, 4 };
static const uchar slovakRules[] =
{ Q_EQ, 1, Q_NEWRULE,
Q_BETWEEN, 2, 4 };
@@ -74,7 +73,7 @@ static const uchar macedonianRules[] =
Q_MOD_10 | Q_EQ, 2 };
static const uchar lithuanianRules[] =
{ Q_MOD_10 | Q_EQ, 1, Q_AND, Q_MOD_100 | Q_NEQ, 11, Q_NEWRULE,
- Q_MOD_10 | Q_EQ, 2, Q_AND, Q_MOD_100 | Q_NOT_BETWEEN, 10, 19 };
+ Q_MOD_10 | Q_NEQ, 0, Q_AND, Q_MOD_100 | Q_NOT_BETWEEN, 10, 19 };
static const uchar russianStyleRules[] =
{ Q_MOD_10 | Q_EQ, 1, Q_AND, Q_MOD_100 | Q_NEQ, 11, Q_NEWRULE,
Q_MOD_10 | Q_BETWEEN, 2, 4, Q_AND, Q_MOD_100 | Q_NOT_BETWEEN, 10, 19 };
@@ -103,27 +102,35 @@ static const uchar arabicRules[] =
Q_EQ, 2, Q_NEWRULE,
Q_MOD_100 | Q_BETWEEN, 3, 10, Q_NEWRULE,
Q_MOD_100 | Q_NEQ, 0 };
+static const uchar tagalogRules[] =
+ { Q_LEQ, 1, Q_NEWRULE,
+ Q_MOD_10 | Q_EQ, 4, Q_OR, Q_MOD_10 | Q_EQ, 6, Q_OR, Q_MOD_10 | Q_EQ, 9 };
+static const uchar catalanRules[] =
+ { Q_EQ, 1, Q_NEWRULE,
+ Q_LEAD_1000 | Q_EQ, 11 };
static const char * const japaneseStyleForms[] = { "Universal Form", 0 };
static const char * const englishStyleForms[] = { "Singular", "Plural", 0 };
static const char * const frenchStyleForms[] = { "Singular", "Plural", 0 };
+static const char * const icelandicForms[] = { "Singular", "Plural", 0 };
static const char * const latvianForms[] = { "Singular", "Plural", "Nullar", 0 };
static const char * const irishStyleForms[] = { "Singular", "Dual", "Plural", 0 };
-static const char * const czechForms[] = { "Singular", "Dual", "Plural", 0 };
-static const char * const slovakForms[] = { "Singular", "Dual", "Plural", 0 };
+static const char * const slovakForms[] = { "Singular", "Paucal", "Plural", 0 };
static const char * const macedonianForms[] = { "Singular", "Dual", "Plural", 0 };
-static const char * const lithuanianForms[] = { "Singular", "Dual", "Plural", 0 };
+static const char * const lithuanianForms[] = { "Singular", "Paucal", "Plural", 0 };
static const char * const russianStyleForms[] = { "Singular", "Dual", "Plural", 0 };
static const char * const polishForms[] = { "Singular", "Paucal", "Plural", 0 };
-static const char * const romanianForms[] =
- { "Singular", "Plural Form for 2 to 19", "Plural", 0 };
+static const char * const romanianForms[] = { "Singular", "Paucal", "Plural", 0 };
static const char * const slovenianForms[] = { "Singular", "Dual", "Trial", "Plural", 0 };
static const char * const malteseForms[] =
- { "Singular", "Plural Form for 2 to 10", "Plural Form for 11 to 19", "Plural", 0 };
+ { "Singular", "Paucal", "Greater Paucal", "Plural", 0 };
static const char * const welshForms[] =
{ "Nullar", "Singular", "Dual", "Sexal", "Plural", 0 };
static const char * const arabicForms[] =
{ "Nullar", "Singular", "Dual", "Minority Plural", "Plural", "Plural Form for 100, 200, ...", 0 };
+static const char * const tagalogForms[] =
+ { "Singular", "Plural (consonant-ended)", "Plural (vowel-ended)", 0 };
+static const char * const catalanForms[] = { "Singular", "Undecal (11)", "Plural", 0 };
#define EOL QLocale::C
@@ -147,6 +154,7 @@ static const QLocale::Language japaneseStyleLanguages[] = {
QLocale::Sundanese,
QLocale::Thai,
QLocale::Tibetan,
+ QLocale::Turkish,
QLocale::Vietnamese,
QLocale::Yoruba,
QLocale::Zhuang,
@@ -169,7 +177,6 @@ static const QLocale::Language englishStyleLanguages[] = {
// Missing: Bokmal,
QLocale::Bulgarian,
QLocale::Cambodian,
- QLocale::Catalan,
QLocale::Cornish,
QLocale::Corsican,
QLocale::Danish,
@@ -190,7 +197,6 @@ static const QLocale::Language englishStyleLanguages[] = {
QLocale::Hausa,
QLocale::Hebrew,
QLocale::Hindi,
- QLocale::Icelandic,
QLocale::Interlingua,
QLocale::Interlingue,
QLocale::Italian,
@@ -231,14 +237,12 @@ static const QLocale::Language englishStyleLanguages[] = {
QLocale::Spanish,
QLocale::Swahili,
QLocale::Swedish,
- QLocale::Tagalog,
QLocale::Tajik,
QLocale::Tamil,
QLocale::Tatar,
QLocale::Telugu,
QLocale::TongaLanguage,
QLocale::Tsonga,
- QLocale::Turkish,
QLocale::Turkmen,
QLocale::Twi,
QLocale::Uigur,
@@ -261,6 +265,7 @@ static const QLocale::Language frenchStyleLanguages[] = {
EOL
};
static const QLocale::Language latvianLanguage[] = { QLocale::Latvian, EOL };
+static const QLocale::Language icelandicLanguage[] = { QLocale::Icelandic, EOL };
static const QLocale::Language irishStyleLanguages[] = {
QLocale::Divehi,
QLocale::Gaelic,
@@ -274,8 +279,7 @@ static const QLocale::Language irishStyleLanguages[] = {
QLocale::Sanskrit,
EOL
};
-static const QLocale::Language czechLanguage[] = { QLocale::Czech, EOL };
-static const QLocale::Language slovakLanguage[] = { QLocale::Slovak, EOL };
+static const QLocale::Language slovakLanguages[] = { QLocale::Slovak, QLocale::Czech, EOL };
static const QLocale::Language macedonianLanguage[] = { QLocale::Macedonian, EOL };
static const QLocale::Language lithuanianLanguage[] = { QLocale::Lithuanian, EOL };
static const QLocale::Language russianStyleLanguages[] = {
@@ -298,6 +302,8 @@ static const QLocale::Language slovenianLanguage[] = { QLocale::Slovenian, EOL }
static const QLocale::Language malteseLanguage[] = { QLocale::Maltese, EOL };
static const QLocale::Language welshLanguage[] = { QLocale::Welsh, EOL };
static const QLocale::Language arabicLanguage[] = { QLocale::Arabic, EOL };
+static const QLocale::Language tagalogLanguage[] = { QLocale::Tagalog, EOL };
+static const QLocale::Language catalanLanguage[] = { QLocale::Catalan, EOL };
static const QLocale::Country frenchStyleCountries[] = {
// keep synchronized with frenchStyleLanguages
@@ -320,9 +326,9 @@ static const NumerusTableEntry numerusTable[] = {
{ frenchStyleRules, sizeof(frenchStyleRules), frenchStyleForms, frenchStyleLanguages,
frenchStyleCountries },
{ latvianRules, sizeof(latvianRules), latvianForms, latvianLanguage, 0 },
+ { icelandicRules, sizeof(icelandicRules), icelandicForms, icelandicLanguage, 0 },
{ irishStyleRules, sizeof(irishStyleRules), irishStyleForms, irishStyleLanguages, 0 },
- { czechRules, sizeof(czechRules), czechForms, czechLanguage, 0 },
- { slovakRules, sizeof(slovakRules), slovakForms, slovakLanguage, 0 },
+ { slovakRules, sizeof(slovakRules), slovakForms, slovakLanguages, 0 },
{ macedonianRules, sizeof(macedonianRules), macedonianForms, macedonianLanguage, 0 },
{ lithuanianRules, sizeof(lithuanianRules), lithuanianForms, lithuanianLanguage, 0 },
{ russianStyleRules, sizeof(russianStyleRules), russianStyleForms, russianStyleLanguages, 0 },
@@ -331,7 +337,9 @@ static const NumerusTableEntry numerusTable[] = {
{ slovenianRules, sizeof(slovenianRules), slovenianForms, slovenianLanguage, 0 },
{ malteseRules, sizeof(malteseRules), malteseForms, malteseLanguage, 0 },
{ welshRules, sizeof(welshRules), welshForms, welshLanguage, 0 },
- { arabicRules, sizeof(arabicRules), arabicForms, arabicLanguage, 0 }
+ { arabicRules, sizeof(arabicRules), arabicForms, arabicLanguage, 0 },
+ { tagalogRules, sizeof(tagalogRules), tagalogForms, tagalogLanguage, 0 },
+ { catalanRules, sizeof(catalanRules), catalanForms, catalanLanguage, 0 }
};
static const int NumerusTableSize = sizeof(numerusTable) / sizeof(numerusTable[0]);
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 422e956..fb33de4 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -447,21 +447,24 @@ int HtmlGenerator::generateAtom(const Atom *atom,
out() << formattingRightMap()[ATOM_FORMATTING_TELETYPE];
break;
case Atom::Code:
- out() << "<pre>" << trimmedTrailing(highlightedCode(indent(codeIndent, atom->string()),
- marker, relative))
+ out() << "<pre>"
+ << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),
+ marker,relative))
<< "</pre>\n";
break;
#ifdef QDOC_QML
case Atom::Qml:
- out() << "<pre>" << trimmedTrailing(highlightedCode(indent(codeIndent, atom->string()),
- marker, relative))
+ out() << "<pre>"
+ << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),
+ marker,relative))
<< "</pre>\n";
break;
#endif
case Atom::CodeNew:
out() << "<p>you can rewrite it as</p>\n"
- << "<pre>" << trimmedTrailing(highlightedCode(indent(codeIndent, atom->string()),
- marker, relative))
+ << "<pre>"
+ << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),
+ marker,relative))
<< "</pre>\n";
break;
case Atom::CodeOld:
@@ -469,7 +472,7 @@ int HtmlGenerator::generateAtom(const Atom *atom,
// fallthrough
case Atom::CodeBad:
out() << "<pre><font color=\"#404040\">"
- << trimmedTrailing(protect(plainCode(indent(codeIndent, atom->string()))))
+ << trimmedTrailing(protect(plainCode(indent(codeIndent,atom->string()))))
<< "</font></pre>\n";
break;
case Atom::FootnoteLeft:
@@ -1045,12 +1048,16 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner,
out() << "<li><a href=\"" << membersLink << "\">"
<< "List of all members, including inherited members</a></li>\n";
- QString obsoleteLink = generateLowStatusMemberFile(inner, marker, CodeMarker::Obsolete);
+ QString obsoleteLink = generateLowStatusMemberFile(inner,
+ marker,
+ CodeMarker::Obsolete);
if (!obsoleteLink.isEmpty())
out() << "<li><a href=\"" << obsoleteLink << "\">"
<< "Obsolete members</a></li>\n";
- QString compatLink = generateLowStatusMemberFile(inner, marker, CodeMarker::Compat);
+ QString compatLink = generateLowStatusMemberFile(inner,
+ marker,
+ CodeMarker::Compat);
if (!compatLink.isEmpty())
out() << "<li><a href=\"" << compatLink << "\">"
<< "Qt 3 support members</a></li>\n";
@@ -1066,9 +1073,11 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner,
if (!s->inherited.isEmpty())
needOtherSection = true;
} else {
- out() << "<a name=\"" << registerRef((*s).name.toLower()) << "\"></a>\n";
- out() << "<h3>" << protect((*s).name) << "</h3>\n";
-
+ out() << "<hr />\n";
+ out() << "<a name=\""
+ << registerRef((*s).name.toLower())
+ << "\"></a>\n";
+ out() << "<h2>" << protect((*s).name) << "</h2>\n";
generateSectionList(*s, inner, marker, CodeMarker::Summary);
}
++s;
@@ -1221,12 +1230,16 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
out() << "<li><a href=\"" << membersLink << "\">"
<< "List of all members, including inherited members</a></li>\n";
- QString obsoleteLink = generateLowStatusMemberFile(fake, marker, CodeMarker::Obsolete);
+ QString obsoleteLink = generateLowStatusMemberFile(fake,
+ marker,
+ CodeMarker::Obsolete);
if (!obsoleteLink.isEmpty())
out() << "<li><a href=\"" << obsoleteLink << "\">"
<< "Obsolete members</a></li>\n";
- QString compatLink = generateLowStatusMemberFile(fake, marker, CodeMarker::Compat);
+ QString compatLink = generateLowStatusMemberFile(fake,
+ marker,
+ CodeMarker::Compat);
if (!compatLink.isEmpty())
out() << "<li><a href=\"" << compatLink << "\">"
<< "Qt 3 support members</a></li>\n";
@@ -1257,7 +1270,7 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
s = sections.begin();
while (s != sections.end()) {
out() << "<a name=\"" << registerRef((*s).name) << "\"></a>\n";
- out() << "<h3>" << protect((*s).name) << "</h3>\n";
+ out() << "<h2>" << protect((*s).name) << "</h2>\n";
generateSectionList(*s, fake, marker, CodeMarker::Summary);
++s;
}
@@ -1533,17 +1546,19 @@ void HtmlGenerator::generateBrief(const Node *node, CodeMarker *marker,
void HtmlGenerator::generateIncludes(const InnerNode *inner, CodeMarker *marker)
{
if (!inner->includes().isEmpty()) {
- out() << "<pre>" << trimmedTrailing(highlightedCode(indent(codeIndent,
- marker->markedUpIncludes(
- inner->includes())),
- marker, inner))
+ out() << "<pre>"
+ << trimmedTrailing(highlightedCode(indent(codeIndent,
+ marker->markedUpIncludes(inner->includes())),
+ marker,inner))
<< "</pre>";
}
}
-void HtmlGenerator::generateTableOfContents(const Node *node, CodeMarker *marker,
+void HtmlGenerator::generateTableOfContents(const Node *node,
+ CodeMarker *marker,
Doc::SectioningUnit sectioningUnit,
- int numColumns, const Node *relative)
+ int numColumns,
+ const Node *relative)
{
if (!node->doc().hasTableOfContents())
@@ -1651,7 +1666,9 @@ QString HtmlGenerator::generateListOfAllMemberFile(const InnerNode *inner, CodeM
QList<Section> sections;
QList<Section>::ConstIterator s;
- sections = marker->sections(inner, CodeMarker::SeparateList, CodeMarker::Okay);
+ sections = marker->sections(inner,
+ CodeMarker::SeparateList,
+ CodeMarker::Okay);
if (sections.isEmpty())
return QString();
@@ -1672,10 +1689,13 @@ QString HtmlGenerator::generateListOfAllMemberFile(const InnerNode *inner, CodeM
return fileName;
}
-QString HtmlGenerator::generateLowStatusMemberFile(const InnerNode *inner, CodeMarker *marker,
+QString HtmlGenerator::generateLowStatusMemberFile(const InnerNode *inner,
+ CodeMarker *marker,
CodeMarker::Status status)
{
- QList<Section> sections = marker->sections(inner, CodeMarker::Summary, status);
+ QList<Section> sections = marker->sections(inner,
+ CodeMarker::Summary,
+ status);
QMutableListIterator<Section> j(sections);
while (j.hasNext()) {
if (j.next().members.size() == 0)
@@ -1712,12 +1732,13 @@ QString HtmlGenerator::generateLowStatusMemberFile(const InnerNode *inner, CodeM
"code.</p>\n";
}
- out() << "<p><ul><li><a href=\"" << linkForNode(inner, 0) << "\">" << protect(inner->name())
+ out() << "<p><ul><li><a href=\""
+ << linkForNode(inner, 0) << "\">"
+ << protect(inner->name())
<< " class reference</a></li></ul></p>\n";
for (i = 0; i < sections.size(); ++i) {
- out() << "<h3>" << protect(sections.at(i).name) << "</h3>\n";
-
+ out() << "<h2>" << protect(sections.at(i).name) << "</h2>\n";
generateSectionList(sections.at(i), inner, marker, CodeMarker::Summary);
}
@@ -1739,8 +1760,9 @@ QString HtmlGenerator::generateLowStatusMemberFile(const InnerNode *inner, CodeM
return fileName;
}
-void HtmlGenerator::generateClassHierarchy(const Node *relative, CodeMarker *marker,
- const QMap<QString, const Node *> &classMap)
+void HtmlGenerator::generateClassHierarchy(const Node *relative,
+ CodeMarker *marker,
+ const QMap<QString,const Node*> &classMap)
{
if (classMap.isEmpty())
return;
@@ -1945,7 +1967,8 @@ void HtmlGenerator::generateCompactList(const Node *relative, CodeMarker *marker
if (currentOffset[i] >= firstOffset[i + 1]) {
// this column is finished
out() << "<td>\n</td>\n";
- } else {
+ }
+ else {
while (currentOffsetInParagraph[i] == paragraph[currentParagraphNo[i]].count()) {
++currentParagraphNo[i];
currentOffsetInParagraph[i] = 0;
@@ -1954,7 +1977,9 @@ void HtmlGenerator::generateCompactList(const Node *relative, CodeMarker *marker
out() << "<td align=\"right\">";
if (currentOffsetInParagraph[i] == 0) {
// start a new paragraph
- out() << "<b>" << paragraphName[currentParagraphNo[i]] << "&nbsp;</b>";
+ out() << "<b>"
+ << paragraphName[currentParagraphNo[i]]
+ << "&nbsp;</b>";
}
out() << "</td>\n";
@@ -1967,7 +1992,9 @@ void HtmlGenerator::generateCompactList(const Node *relative, CodeMarker *marker
out() << "<td>";
// Previously, we used generateFullName() for this, but we
// require some special formatting.
- out() << "<a href=\"" << linkForNode(it.value(), relative) << "\">";
+ out() << "<a href=\""
+ << linkForNode(it.value(), relative)
+ << "\">";
QStringList pieces = fullName(it.value(), relative, marker).split("::");
out() << protect(pieces.last());
out() << "</a>";
@@ -1987,7 +2014,8 @@ void HtmlGenerator::generateCompactList(const Node *relative, CodeMarker *marker
out() << "</table></p>\n";
}
-void HtmlGenerator::generateFunctionIndex(const Node *relative, CodeMarker *marker)
+void HtmlGenerator::generateFunctionIndex(const Node *relative,
+ CodeMarker *marker)
{
out() << "<p align=\"center\"><font size=\"+1\"><b>";
for (int i = 0; i < 26; i++) {
@@ -2302,12 +2330,13 @@ void HtmlGenerator::generateSynopsis(const Node *node,
marked.replace("<@type>", "");
marked.replace("</@type>", "");
}
- out() << highlightedCode(marked, marker, relative, nameAlignment);
+ out() << highlightedCode(marked, marker, relative, style, nameAlignment);
}
QString HtmlGenerator::highlightedCode(const QString& markedCode,
CodeMarker *marker,
const Node *relative,
+ CodeMarker::SynopsisStyle ,
bool nameAlignment)
{
QString src = markedCode;
@@ -2320,15 +2349,20 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode,
// replace all <@link> tags: "(<@link node=\"([^\"]+)\">).*(</@link>)"
static const QString linkTag("link");
+ bool done = false;
for (int i = 0, n = src.size(); i < n;) {
if (src.at(i) == charLangle && src.at(i + 1).unicode() == '@') {
- if (nameAlignment) // && (i != 0)) Why was this here?
- html += "&nbsp;</td><td class=\"memItemRight\" valign=\"bottom\">";
+ if (nameAlignment && !done) {// && (i != 0)) Why was this here?
+ html += "</td><td class=\"memItemRight\" valign=\"bottom\">";
+ done = true;
+ }
i += 2;
if (parseArg(src, linkTag, &i, n, &arg, &par1)) {
+ html += "<b>";
QString link = linkForNode(
CodeMarker::nodeForString(par1.toString()), relative);
addLink(link, arg, &html);
+ html += "</b>";
}
else {
html += charLangle;
diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h
index ec9532f..36a2e30 100644
--- a/tools/qdoc3/htmlgenerator.h
+++ b/tools/qdoc3/htmlgenerator.h
@@ -158,6 +158,7 @@ class HtmlGenerator : public PageGenerator
QString highlightedCode(const QString& markedCode,
CodeMarker *marker,
const Node *relative,
+ CodeMarker::SynopsisStyle style = CodeMarker::Accessors,
bool nameAlignment = false);
#else
void generateSynopsis(const Node *node,
diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro
index 2bba8fb..ed27669 100644
--- a/tools/qdoc3/qdoc3.pro
+++ b/tools/qdoc3/qdoc3.pro
@@ -1,6 +1,8 @@
DEFINES += QDOC2_COMPAT
-#DEFINES += QT_NO_CAST_TO_ASCII
+DEFINES += QT_NO_CAST_TO_ASCII
#DEFINES += QT_NO_CAST_FROM_ASCII
+#DEFINES += QT_USE_FAST_OPERATOR_PLUS
+#DEFINES += QT_USE_FAST_CONCATENATION
QT = core xml
CONFIG += console
diff --git a/tools/qdoc3/test/classic.css b/tools/qdoc3/test/classic.css
index 5239856..9c59c81 100644
--- a/tools/qdoc3/test/classic.css
+++ b/tools/qdoc3/test/classic.css
@@ -14,13 +14,49 @@ H3 {
h3.fn,span.fn
{
- background-color: #d5e1d5;
+ background-color: #eee;
border-width: 1px;
border-style: solid;
- border-color: #66bc29;
+ border-color: #ddd #ddd #ddd #ddd ;
font-weight: bold;
- -moz-border-radius: 8px 8px 8px 8px;
padding: 6px 0px 6px 10px;
+ margin: 42px 0px 0px 0px;
+}
+
+hr {
+ border: 0;
+ color: #9E9E9E;
+ background-color: #ccc;
+ height: 1px;
+ width: 100%;
+ text-align: left;
+ margin: 34px 0px 34px 0px;
+}
+
+table {
+ border-width: 1px 1px 1px 1px;
+ border-style: solid;
+ border-color: #dddddd;
+ border-collapse: collapse;
+ background-color: #f0f0f0;
+ margin-left: 1.5%;
+ width: 97%
+}
+
+table th {
+ border-width: 1px 1px 1px 2px;
+ padding: 4px;
+ border-style: solid;
+ border-color: #444;
+ color:white;
+ background-color:#444;
+}
+
+p {
+ margin-left: 1.5%;
+ margin-top: 8px;
+ width: 97%
+ margin-bottom: 8px;
}
a:link
@@ -66,8 +102,8 @@ body
}
table td.memItemLeft {
- width: 100px;
- padding: 1px 0px 0px 8px;
+ width: 200px;
+ padding: 2px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
@@ -77,7 +113,7 @@ table td.memItemLeft {
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
- border-top-style: solid;
+ border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
@@ -86,7 +122,7 @@ table td.memItemLeft {
white-space: nowrap
}
table td.memItemRight {
- padding: 1px 8px 0px 8px;
+ padding: 2px 8px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
@@ -96,7 +132,7 @@ table td.memItemRight {
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
- border-top-style: solid;
+ border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp
index 0fbd438..370bd5a 100644
--- a/tools/qdoc3/tree.cpp
+++ b/tools/qdoc3/tree.cpp
@@ -1884,23 +1884,25 @@ QString Tree::fullDocumentLocation(const Node *node) const
if (!node->url().isEmpty())
return node->url();
+ QString parentName;
+ QString anchorRef;
+
if (node->type() == Node::Namespace) {
// The root namespace has no name - check for this before creating
// an attribute containing the location of any documentation.
if (!node->fileBase().isEmpty())
- return node->fileBase() + ".html";
+ parentName = node->fileBase() + ".html";
else
return "";
}
else if (node->type() == Node::Fake) {
- return node->fileBase() + ".html";
+ parentName = node->fileBase() + ".html";
}
else if (node->fileBase().isEmpty())
return "";
- QString parentName;
Node *parentNode = 0;
if ((parentNode = node->relates()))
@@ -1912,10 +1914,11 @@ QString Tree::fullDocumentLocation(const Node *node) const
case Node::Class:
case Node::Namespace:
if (parentNode && !parentNode->name().isEmpty())
- return parentName.replace(".html", "") + "-"
- + node->fileBase().toLower() + ".html";
+ parentName = parentName.replace(".html", "") + "-"
+ + node->fileBase().toLower() + ".html";
else
- return node->fileBase() + ".html";
+ parentName = node->fileBase() + ".html";
+ break;
case Node::Function:
{
/*
@@ -1925,29 +1928,17 @@ QString Tree::fullDocumentLocation(const Node *node) const
const FunctionNode *functionNode =
static_cast<const FunctionNode *>(node);
- // Functions can be compatibility functions or be obsolete.
- switch (node->status()) {
- case Node::Compat:
- parentName.replace(".html", "-qt3.html");
- break;
- case Node::Obsolete:
- parentName.replace(".html", "-obsolete.html");
- break;
- default:
- ;
- }
-
if (functionNode->metaness() == FunctionNode::Dtor)
- return parentName + "#dtor." + functionNode->name().mid(1);
+ anchorRef = "#dtor." + functionNode->name().mid(1);
- if (functionNode->associatedProperty())
+ else if (functionNode->associatedProperty())
return fullDocumentLocation(functionNode->associatedProperty());
- if (functionNode->overloadNumber() > 1)
- return parentName + "#" + functionNode->name()
- + "-" + QString::number(functionNode->overloadNumber());
+ else if (functionNode->overloadNumber() > 1)
+ anchorRef = "#" + functionNode->name()
+ + "-" + QString::number(functionNode->overloadNumber());
else
- return parentName + "#" + functionNode->name();
+ anchorRef = "#" + functionNode->name();
}
/*
@@ -1955,27 +1946,52 @@ QString Tree::fullDocumentLocation(const Node *node) const
the latter returns the name in lower-case. For
HTML anchors, we need to preserve the case.
*/
+ break;
case Node::Enum:
- return parentName + "#" + node->name() + "-enum";
+ anchorRef = "#" + node->name() + "-enum";
+ break;
case Node::Typedef:
- return parentName + "#" + node->name() + "-typedef";
+ anchorRef = "#" + node->name() + "-typedef";
+ break;
case Node::Property:
- return parentName + "#" + node->name() + "-prop";
+ anchorRef = "#" + node->name() + "-prop";
+ break;
case Node::Variable:
- return parentName + "#" + node->name() + "-var";
+ anchorRef = "#" + node->name() + "-var";
+ break;
case Node::Target:
- return parentName + "#" + Doc::canonicalTitle(node->name());
+ anchorRef = "#" + Doc::canonicalTitle(node->name());
+ break;
case Node::Fake:
{
- QString pageName = node->name();
- return pageName.replace("/", "-").replace(".", "-") + ".html";
+ /*
+ Use node->fileBase() for fake nodes because they are represented
+ by pages whose file names are lower-case.
+ */
+ parentName = node->fileBase();
+ parentName.replace("/", "-").replace(".", "-");
+ parentName += ".html";
}
break;
default:
break;
}
- return "";
+ // Various objects can be compat (deprecated) or obsolete.
+ if (node->type() != Node::Class && node->type() != Node::Namespace) {
+ switch (node->status()) {
+ case Node::Compat:
+ parentName.replace(".html", "-qt3.html");
+ break;
+ case Node::Obsolete:
+ parentName.replace(".html", "-obsolete.html");
+ break;
+ default:
+ ;
+ }
+ }
+
+ return parentName.toLower() + anchorRef;
}
/*!