Commit 0150f0b0 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

WelcomePage.exampleListModel: remove html text from description

This is needed because maximumLineCount is only supportted for plainText.

Change-Id: I8d05a7939603741985458ff7b40c8b33f11cbb1a
Reviewed-on: http://codereview.qt-project.org/5704

Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 72f221c0
......@@ -73,6 +73,16 @@ ExamplesListModel::ExamplesListModel(QObject *parent) :
SLOT(helpInitialized()));
}
static inline QString fixSTringForTags(const QString &string)
{
QString returnString = string;
returnString.replace(QLatin1String("<i>"), QChar());
returnString.replace(QLatin1String("</i>"), QChar());
returnString.replace(QLatin1String("<tt>"), QChar());
returnString.replace(QLatin1String("</tt>"), QChar());
return returnString;
}
QList<ExampleItem> ExamplesListModel::parseExamples(QXmlStreamReader* reader, const QString& projectsOffset)
{
QList<ExampleItem> examples;
......@@ -94,7 +104,7 @@ QList<ExampleItem> ExamplesListModel::parseExamples(QXmlStreamReader* reader, co
} else if (reader->name() == QLatin1String("fileToOpen")) {
item.filesToOpen.append(projectsOffset + '/' + reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement));
} else if (reader->name() == QLatin1String("description")) {
item.description = reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement);
item.description = fixSTringForTags(reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement));
} else if (reader->name() == QLatin1String("tags")) {
item.tags = reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement).split(",");
m_tags.append(item.tags);
......@@ -134,7 +144,7 @@ QList<ExampleItem> ExamplesListModel::parseDemos(QXmlStreamReader* reader, const
} else if (reader->name() == QLatin1String("fileToOpen")) {
item.filesToOpen.append(projectsOffset + '/' + reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement));
} else if (reader->name() == QLatin1String("description")) {
item.description = reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement);
item.description = fixSTringForTags(reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement));
} else if (reader->name() == QLatin1String("tags")) {
item.tags = reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement).split(",");
}
......@@ -173,7 +183,7 @@ QList<ExampleItem> ExamplesListModel::parseTutorials(QXmlStreamReader* reader, c
} else if (reader->name() == QLatin1String("fileToOpen")) {
item.filesToOpen.append(projectsOffset + '/' + reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement));
} else if (reader->name() == QLatin1String("description")) {
item.description = reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement);
item.description = fixSTringForTags(reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement));
} else if (reader->name() == QLatin1String("tags")) {
item.tags = reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement).split(",");
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment