summaryrefslogtreecommitdiff
path: root/demos/qtdemo/examplecontent.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@nokia.com>2010-07-01 11:58:17 +0200
committerMartin Smith <martin.smith@nokia.com>2010-07-01 11:58:17 +0200
commit657aa5c630b4321bc793d07230acad58e524f93e (patch)
tree68a342858f7c3bc8e9bcff7902b4444d4c136d9c /demos/qtdemo/examplecontent.cpp
parent5180e192c2fdb7735aa062e35179415de40834a2 (diff)
downloadqt4-tools-657aa5c630b4321bc793d07230acad58e524f93e.tar.gz
qdoc: Fixed invalid format in the html header.
Task-number: QTBUG-11803
Diffstat (limited to 'demos/qtdemo/examplecontent.cpp')
-rw-r--r--demos/qtdemo/examplecontent.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/demos/qtdemo/examplecontent.cpp b/demos/qtdemo/examplecontent.cpp
index b93062cedd..19be3e0e0f 100644
--- a/demos/qtdemo/examplecontent.cpp
+++ b/demos/qtdemo/examplecontent.cpp
@@ -79,14 +79,20 @@ void ExampleContent::animationStopped(int id)
QString ExampleContent::loadDescription()
{
QByteArray ba = MenuManager::instance()->getHtml(this->name);
+ QString errorMsg;
+ int errorLine, errorColumn;
QDomDocument exampleDoc;
- exampleDoc.setContent(ba, false);
+ if (!exampleDoc.setContent(ba, false, &errorMsg, &errorLine, &errorColumn)) {
+ qDebug() << errorMsg << errorLine << errorColumn;
+ }
QDomNodeList paragraphs = exampleDoc.elementsByTagName("p");
if (paragraphs.length() < 1 && Colors::verbose)
- qDebug() << "- ExampleContent::loadDescription(): Could not load description:" << MenuManager::instance()->info[this->name]["docfile"];
- QString description = Colors::contentColor + QLatin1String("Could not load description. Ensure that the documentation for Qt is built.");
+ qDebug() << "- ExampleContent::loadDescription(): Could not load description:"
+ << MenuManager::instance()->info[this->name]["docfile"];
+ QString description = Colors::contentColor +
+ QLatin1String("Could not load description. Ensure that the documentation for Qt is built.");
for (int p = 0; p < int(paragraphs.length()); ++p) {
description = this->extractTextFromParagraph(paragraphs.item(p));
if (this->isSummary(description)) {
@@ -99,7 +105,8 @@ QString ExampleContent::loadDescription()
bool ExampleContent::isSummary(const QString &text)
{
return (!text.contains("[") &&
- text.indexOf(QRegExp(QString("(In )?((The|This) )?(%1 )?.*(tutorial|example|demo|application)").arg(this->name), Qt::CaseInsensitive)) != -1);
+ text.indexOf(QRegExp(QString("(In )?((The|This) )?(%1 )?.*(tutorial|example|demo|application)").arg(this->name),
+ Qt::CaseInsensitive)) != -1);
}
QString ExampleContent::extractTextFromParagraph(const QDomNode &parentNode)