aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio Martins <[email protected]>2015-08-15 00:20:17 +0100
committerSergio Martins <[email protected]>2015-08-15 00:20:17 +0100
commit88ceeee07c82d17aae536fcc869293bdbd55fcf1 (patch)
treef34c17f6db95e1e1477d841171d5b2c3708c0e97
parentdc9eb00a24db578c82e87429fd6a01fa4c7fa6ca (diff)
Avoid allocations due to QLatin1String->QString conversion
Only the QString functions taking a QLatin1String overload are OK.
-rw-r--r--src/syndication/atom/atomtools.cpp2
-rw-r--r--src/syndication/atom/category.cpp6
-rw-r--r--src/syndication/atom/constants.cpp4
-rw-r--r--src/syndication/atom/content.cpp22
-rw-r--r--src/syndication/atom/document.cpp52
-rw-r--r--src/syndication/atom/entry.cpp48
-rw-r--r--src/syndication/atom/generator.cpp4
-rw-r--r--src/syndication/atom/link.cpp12
-rw-r--r--src/syndication/atom/parser.cpp34
-rw-r--r--src/syndication/atom/person.cpp6
-rw-r--r--src/syndication/atom/source.cpp24
-rw-r--r--src/syndication/constants.cpp14
-rw-r--r--src/syndication/dataretriever.cpp6
-rw-r--r--src/syndication/documentsource.cpp2
-rw-r--r--src/syndication/elementwrapper.cpp12
-rw-r--r--src/syndication/loader.cpp4
-rw-r--r--src/syndication/mapper/enclosurerss2impl.cpp4
-rw-r--r--src/syndication/mapper/itematomimpl.cpp6
-rw-r--r--src/syndication/mapper/itemrss2impl.cpp10
-rw-r--r--src/syndication/rdf/contentvocab.cpp2
-rw-r--r--src/syndication/rdf/dublincorevocab.cpp2
-rw-r--r--src/syndication/rdf/modelmaker.cpp4
-rw-r--r--src/syndication/rdf/parser.cpp8
-rw-r--r--src/syndication/rdf/rdfvocab.cpp2
-rw-r--r--src/syndication/rdf/rssvocab.cpp4
-rw-r--r--src/syndication/rdf/syndicationinfo.cpp10
-rw-r--r--src/syndication/rdf/syndicationvocab.cpp2
-rw-r--r--src/syndication/rss2/category.cpp2
-rw-r--r--src/syndication/rss2/cloud.cpp12
-rw-r--r--src/syndication/rss2/document.cpp114
-rw-r--r--src/syndication/rss2/enclosure.cpp8
-rw-r--r--src/syndication/rss2/image.cpp12
-rw-r--r--src/syndication/rss2/item.cpp54
-rw-r--r--src/syndication/rss2/parser.cpp4
-rw-r--r--src/syndication/rss2/source.cpp2
-rw-r--r--src/syndication/rss2/textinput.cpp8
-rw-r--r--src/syndication/rss2/tools_p.cpp6
-rw-r--r--src/syndication/tools.cpp20
38 files changed, 274 insertions, 274 deletions
diff --git a/src/syndication/atom/atomtools.cpp b/src/syndication/atom/atomtools.cpp
index 44a4a07..1f16aec 100644
--- a/src/syndication/atom/atomtools.cpp
+++ b/src/syndication/atom/atomtools.cpp
@@ -42,7 +42,7 @@ QString extractAtomText(const Syndication::ElementWrapper &parent, const QString
bool isCDATA = el.firstChild().isCDATASection();
- QString type = el.attribute(QLatin1String("type"), QLatin1String("text"));
+ QString type = el.attribute(QStringLiteral("type"), QStringLiteral("text"));
if (type == QLatin1String("text")) {
str = parent.extractElementTextNS(atom1Namespace(), tagname).trimmed();
diff --git a/src/syndication/atom/category.cpp b/src/syndication/atom/category.cpp
index 85564ec..9922eb1 100644
--- a/src/syndication/atom/category.cpp
+++ b/src/syndication/atom/category.cpp
@@ -41,7 +41,7 @@ Category::Category(const QDomElement &element) : ElementWrapper(element)
QString Category::term() const
{
- return attribute(QLatin1String("term"));
+ return attribute(QStringLiteral("term"));
}
QString Category::scheme() const
@@ -49,12 +49,12 @@ QString Category::scheme() const
// NOTE: The scheme IRI is not completed by purpose.
// According to Atom spec, it must be an absolute IRI.
// If this is a problem with real-world feeds, it might be changed.
- return attribute(QLatin1String("scheme"));
+ return attribute(QStringLiteral("scheme"));
}
QString Category::label() const
{
- return attribute(QLatin1String("label"));
+ return attribute(QStringLiteral("label"));
}
QString Category::debugInfo() const
diff --git a/src/syndication/atom/constants.cpp b/src/syndication/atom/constants.cpp
index b113dc1..ad24b02 100644
--- a/src/syndication/atom/constants.cpp
+++ b/src/syndication/atom/constants.cpp
@@ -31,12 +31,12 @@ namespace Atom
QString atom1Namespace()
{
- return QLatin1String("http://www.w3.org/2005/Atom");
+ return QStringLiteral("http://www.w3.org/2005/Atom");
}
QString atom0_3Namespace()
{
- return QLatin1String("http://purl.org/atom/ns#");
+ return QStringLiteral("http://purl.org/atom/ns#");
}
} // namespace Atom
diff --git a/src/syndication/atom/content.cpp b/src/syndication/atom/content.cpp
index cd975e5..c7892bc 100644
--- a/src/syndication/atom/content.cpp
+++ b/src/syndication/atom/content.cpp
@@ -70,12 +70,12 @@ Content &Content::operator=(const Content &other)
QString Content::type() const
{
- return attribute(QLatin1String("type"));
+ return attribute(QStringLiteral("type"));
}
QString Content::src() const
{
- return completeURI(attribute(QLatin1String("src")));
+ return completeURI(attribute(QStringLiteral("src")));
}
QByteArray Content::asByteArray() const
@@ -97,7 +97,7 @@ Content::Format Content::mapTypeToFormat(const QString &typep, const QString &s
//Atom Processors MUST behave as though the type attribute were
//present with a value of "text""
if (type.isNull() && src.isEmpty()) {
- type = QLatin1String("text");
+ type = QStringLiteral("text");
}
if (type == QLatin1String("html")
@@ -113,15 +113,15 @@ Content::Format Content::mapTypeToFormat(const QString &typep, const QString &s
}
if (xmltypes.isEmpty()) {
- xmltypes.append(QLatin1String("xhtml"));
- xmltypes.append(QLatin1String("application/xhtml+xml"));
+ xmltypes.append(QStringLiteral("xhtml"));
+ xmltypes.append(QStringLiteral("application/xhtml+xml"));
// XML media types as defined in RFC3023:
- xmltypes.append(QLatin1String("text/xml"));
- xmltypes.append(QLatin1String("application/xml"));
- xmltypes.append(QLatin1String("text/xml-external-parsed-entity"));
- xmltypes.append(QLatin1String("application/xml-external-parsed-entity"));
- xmltypes.append(QLatin1String("application/xml-dtd"));
- xmltypes.append(QLatin1String("text/x-dtd")); // from shared-mime-info
+ xmltypes.append(QStringLiteral("text/xml"));
+ xmltypes.append(QStringLiteral("application/xml"));
+ xmltypes.append(QStringLiteral("text/xml-external-parsed-entity"));
+ xmltypes.append(QStringLiteral("application/xml-external-parsed-entity"));
+ xmltypes.append(QStringLiteral("application/xml-dtd"));
+ xmltypes.append(QStringLiteral("text/x-dtd")); // from shared-mime-info
}
if (xmltypes.contains(type)
diff --git a/src/syndication/atom/document.cpp b/src/syndication/atom/document.cpp
index 23bff44..1263ee8 100644
--- a/src/syndication/atom/document.cpp
+++ b/src/syndication/atom/document.cpp
@@ -58,7 +58,7 @@ QList<Person> FeedDocument::authors() const
{
QList<QDomElement> a =
elementsByTagNameNS(atom1Namespace(),
- QLatin1String("author"));
+ QStringLiteral("author"));
QList<Person> list;
list.reserve(a.count());
@@ -76,7 +76,7 @@ QList<Person> FeedDocument::contributors() const
{
QList<QDomElement> a =
elementsByTagNameNS(atom1Namespace(),
- QLatin1String("contributor"));
+ QStringLiteral("contributor"));
QList<Person> list;
list.reserve(a.count());
@@ -94,7 +94,7 @@ QList<Category> FeedDocument::categories() const
{
QList<QDomElement> a =
elementsByTagNameNS(atom1Namespace(),
- QLatin1String("category"));
+ QStringLiteral("category"));
QList<Category> list;
list.reserve(a.count());
@@ -111,48 +111,48 @@ QList<Category> FeedDocument::categories() const
Generator FeedDocument::generator() const
{
return Generator(firstElementByTagNameNS(atom1Namespace(),
- QLatin1String("generator")));
+ QStringLiteral("generator")));
}
QString FeedDocument::icon() const
{
return completeURI(extractElementTextNS(atom1Namespace(),
- QLatin1String("icon")));
+ QStringLiteral("icon")));
}
QString FeedDocument::logo() const
{
return completeURI(extractElementTextNS(atom1Namespace(),
- QLatin1String("logo")));
+ QStringLiteral("logo")));
}
QString FeedDocument::id() const
{
return extractElementTextNS(atom1Namespace(),
- QLatin1String("id"));
+ QStringLiteral("id"));
}
QString FeedDocument::rights() const
{
- return extractAtomText(*this, QLatin1String("rights"));
+ return extractAtomText(*this, QStringLiteral("rights"));
}
QString FeedDocument::title() const
{
- return extractAtomText(*this, QLatin1String("title"));
+ return extractAtomText(*this, QStringLiteral("title"));
}
QString FeedDocument::subtitle() const
{
- return extractAtomText(*this, QLatin1String("subtitle"));
+ return extractAtomText(*this, QStringLiteral("subtitle"));
}
time_t FeedDocument::updated() const
{
QString upd = extractElementTextNS(atom1Namespace(),
- QLatin1String("updated"));
+ QStringLiteral("updated"));
return parseDate(upd, ISODate);
}
@@ -160,7 +160,7 @@ QList<Link> FeedDocument::links() const
{
QList<QDomElement> a =
elementsByTagNameNS(atom1Namespace(),
- QLatin1String("link"));
+ QStringLiteral("link"));
QList<Link> list;
list.reserve(a.count());
@@ -178,7 +178,7 @@ QList<Entry> FeedDocument::entries() const
{
QList<QDomElement> a =
elementsByTagNameNS(atom1Namespace(),
- QLatin1String("entry"));
+ QStringLiteral("entry"));
QList<Entry> list;
list.reserve(a.count());
@@ -201,19 +201,19 @@ QList<QDomElement> FeedDocument::unhandledElements() const
static QList<ElementType> handled;
if (handled.isEmpty()) {
handled.reserve(13);
- handled.append(ElementType(QLatin1String("author"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("contributor"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("category"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("generator"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("icon"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("logo"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("id"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("rights"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("title"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("subtitle"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("updated"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("link"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("entry"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("author"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("contributor"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("category"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("generator"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("icon"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("logo"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("id"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("rights"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("title"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("subtitle"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("updated"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("link"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("entry"), atom1Namespace()));
}
QList<QDomElement> notHandled;
diff --git a/src/syndication/atom/entry.cpp b/src/syndication/atom/entry.cpp
index 2a57685..63aba2e 100644
--- a/src/syndication/atom/entry.cpp
+++ b/src/syndication/atom/entry.cpp
@@ -56,7 +56,7 @@ QList<Person> Entry::authors() const
{
QList<QDomElement> a =
elementsByTagNameNS(atom1Namespace(),
- QLatin1String("author"));
+ QStringLiteral("author"));
QList<Person> list;
if (!a.isEmpty()) {
@@ -82,7 +82,7 @@ QList<Person> Entry::contributors() const
{
QList<QDomElement> a =
elementsByTagNameNS(atom1Namespace(),
- QLatin1String("contributor"));
+ QStringLiteral("contributor"));
QList<Person> list;
QList<QDomElement>::ConstIterator it = a.constBegin();
@@ -100,7 +100,7 @@ QList<Category> Entry::categories() const
{
QList<QDomElement> a =
elementsByTagNameNS(atom1Namespace(),
- QLatin1String("category"));
+ QStringLiteral("category"));
QList<Category> list;
list.reserve(a.count());
@@ -117,7 +117,7 @@ QList<Category> Entry::categories() const
QString Entry::id() const
{
return extractElementTextNS(atom1Namespace(),
- QLatin1String("id"));
+ QStringLiteral("id"));
}
@@ -125,7 +125,7 @@ QList<Link> Entry::links() const
{
QList<QDomElement> a =
elementsByTagNameNS(atom1Namespace(),
- QLatin1String("link"));
+ QStringLiteral("link"));
QList<Link> list;
list.reserve(a.count());
@@ -141,43 +141,43 @@ QList<Link> Entry::links() const
QString Entry::rights() const
{
- return extractAtomText(*this, QLatin1String("rights"));
+ return extractAtomText(*this, QStringLiteral("rights"));
}
Source Entry::source() const
{
return Source(firstElementByTagNameNS(atom1Namespace(),
- QLatin1String("source")));
+ QStringLiteral("source")));
}
time_t Entry::published() const
{
QString pub = extractElementTextNS(atom1Namespace(),
- QLatin1String("published"));
+ QStringLiteral("published"));
return parseDate(pub, ISODate);
}
time_t Entry::updated() const
{
QString upd = extractElementTextNS(atom1Namespace(),
- QLatin1String("updated"));
+ QStringLiteral("updated"));
return parseDate(upd, ISODate);
}
QString Entry::summary() const
{
- return extractAtomText(*this, QLatin1String("summary"));
+ return extractAtomText(*this, QStringLiteral("summary"));
}
QString Entry::title() const
{
- return extractAtomText(*this, QLatin1String("title"));
+ return extractAtomText(*this, QStringLiteral("title"));
}
Content Entry::content() const
{
return Content(firstElementByTagNameNS(atom1Namespace(),
- QLatin1String("content")));
+ QStringLiteral("content")));
}
QList<QDomElement> Entry::unhandledElements() const
@@ -186,18 +186,18 @@ QList<QDomElement> Entry::unhandledElements() const
static QList<ElementType> handled;
if (handled.isEmpty()) {
handled.reserve(12);
- handled.append(ElementType(QLatin1String("author"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("contributor"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("category"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("id"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("link"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("rights"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("source"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("published"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("updated"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("summary"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("title"), atom1Namespace()));
- handled.append(ElementType(QLatin1String("content"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("author"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("contributor"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("category"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("id"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("link"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("rights"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("source"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("published"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("updated"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("summary"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("title"), atom1Namespace()));
+ handled.append(ElementType(QStringLiteral("content"), atom1Namespace()));
}
QList<QDomElement> notHandled;
diff --git a/src/syndication/atom/generator.cpp b/src/syndication/atom/generator.cpp
index df31d13..41bc129 100644
--- a/src/syndication/atom/generator.cpp
+++ b/src/syndication/atom/generator.cpp
@@ -40,7 +40,7 @@ Generator::Generator(const QDomElement &element) : ElementWrapper(element)
QString Generator::uri() const
{
- return completeURI(attribute(QLatin1String("uri")));
+ return completeURI(attribute(QStringLiteral("uri")));
}
QString Generator::name() const
@@ -50,7 +50,7 @@ QString Generator::name() const
QString Generator::version() const
{
- return attribute(QLatin1String("version"));
+ return attribute(QStringLiteral("version"));
}
QString Generator::debugInfo() const
diff --git a/src/syndication/atom/link.cpp b/src/syndication/atom/link.cpp
index b5a82fa..eb3d4eb 100644
--- a/src/syndication/atom/link.cpp
+++ b/src/syndication/atom/link.cpp
@@ -40,33 +40,33 @@ Link::Link(const QDomElement &element) : ElementWrapper(element)
QString Link::href() const
{
- return completeURI(attribute(QLatin1String("href")));
+ return completeURI(attribute(QStringLiteral("href")));
}
QString Link::rel() const
{
//"alternate" is default
- return attribute(QLatin1String("rel"), QLatin1String("alternate"));
+ return attribute(QStringLiteral("rel"), QStringLiteral("alternate"));
}
QString Link::type() const
{
- return attribute(QLatin1String("type"));
+ return attribute(QStringLiteral("type"));
}
QString Link::hrefLanguage() const
{
- return attribute(QLatin1String("hreflang"));
+ return attribute(QStringLiteral("hreflang"));
}
QString Link::title() const
{
- return attribute(QLatin1String("title"));
+ return attribute(QStringLiteral("title"));
}
uint Link::length() const
{
- QString lengthStr = attribute(QLatin1String("length"));
+ QString lengthStr = attribute(QStringLiteral("length"));
bool ok;
uint c = lengthStr.toUInt(&ok);
diff --git a/src/syndication/atom/parser.cpp b/src/syndication/atom/parser.cpp
index e996813..772758c 100644
--- a/src/syndication/atom/parser.cpp
+++ b/src/syndication/atom/parser.cpp
@@ -65,14 +65,14 @@ Syndication::SpecificDocumentPtr Parser::parse(const Syndication::DocumentSource
return FeedDocumentPtr(new FeedDocument());
}
- QDomElement feed = doc.namedItem(QLatin1String("feed")).toElement();
+ QDomElement feed = doc.namedItem(QStringLiteral("feed")).toElement();
bool feedValid = !feed.isNull();
- if (feedValid && feed.attribute(QLatin1String("version"))
+ if (feedValid && feed.attribute(QStringLiteral("version"))
== QLatin1String("0.3")) {
doc = ParserPrivate::convertAtom0_3(doc);
- feed = doc.namedItem(QLatin1String("feed")).toElement();
+ feed = doc.namedItem(QStringLiteral("feed")).toElement();
}
@@ -82,7 +82,7 @@ Syndication::SpecificDocumentPtr Parser::parse(const Syndication::DocumentSource
return FeedDocumentPtr(new FeedDocument(feed));
}
- QDomElement entry = doc.namedItem(QLatin1String("entry")).toElement();
+ QDomElement entry = doc.namedItem(QStringLiteral("entry")).toElement();
bool entryValid = !entry.isNull() && entry.namespaceURI() == atom1Namespace();
if (entryValid) {
@@ -95,7 +95,7 @@ Syndication::SpecificDocumentPtr Parser::parse(const Syndication::DocumentSource
QString Parser::format() const
{
- return QLatin1String("atom");
+ return QStringLiteral("atom");
}
QDomNode Parser::ParserPrivate::convertNode(QDomDocument &doc, const QDomNode &node, const QHash<QString, QString> &nameMapper)
@@ -140,31 +140,31 @@ QDomNode Parser::ParserPrivate::convertNode(QDomDocument &doc, const QDomNode &n
// for atom text constructs, map to new type schema (which only allows text, type, xhtml)
if (isTextConstruct) {
- QString oldType = newEl.attribute(QLatin1String("type"), QLatin1String("text/plain"));
+ QString oldType = newEl.attribute(QStringLiteral("type"), QStringLiteral("text/plain"));
QString newType;
Content::Format format = Content::mapTypeToFormat(oldType);
switch (format) {
case Content::XML:
- newType = QLatin1String("xhtml");
+ newType = QStringLiteral("xhtml");
break;
case Content::EscapedHTML:
- newType = QLatin1String("html");
+ newType = QStringLiteral("html");
break;
case Content::PlainText:
case Content::Binary:
default:
- newType = QLatin1String("text");
+ newType = QStringLiteral("text");
}
- newEl.setAttribute(QLatin1String("type"), newType);
+ newEl.setAttribute(QStringLiteral("type"), newType);
} else {
// for generator, rename the "url" attribute to "uri"
bool isGenerator = newNS == atom1Namespace() && newName == QLatin1String("generator");
- if (isGenerator && newEl.hasAttribute(QLatin1String("url"))) {
- newEl.setAttribute(QLatin1String("uri"), newEl.attribute(QLatin1String("url")));
+ if (isGenerator && newEl.hasAttribute(QStringLiteral("url"))) {
+ newEl.setAttribute(QStringLiteral("uri"), newEl.attribute(QStringLiteral("url")));
}
}
@@ -183,11 +183,11 @@ QDomDocument Parser::ParserPrivate::convertAtom0_3(const QDomDocument &doc03)
// these are the tags that were renamed in 1.0
QHash<QString, QString> nameMapper;
- nameMapper.insert(QLatin1String("issued"), QLatin1String("published"));
- nameMapper.insert(QLatin1String("modified"), QLatin1String("updated"));
- nameMapper.insert(QLatin1String("url"), QLatin1String("uri"));
- nameMapper.insert(QLatin1String("copyright"), QLatin1String("rights"));
- nameMapper.insert(QLatin1String("tagline"), QLatin1String("subtitle"));
+ nameMapper.insert(QStringLiteral("issued"), QStringLiteral("published"));
+ nameMapper.insert(QStringLiteral("modified"), QStringLiteral("updated"));
+ nameMapper.insert(QStringLiteral("url"), QStringLiteral("uri"));
+ nameMapper.insert(QStringLiteral("copyright"), QStringLiteral("rights"));
+ nameMapper.insert(QStringLiteral("tagline"), QStringLiteral("subtitle"));
QDomNodeList children = doc03.childNodes();
diff --git a/src/syndication/atom/person.cpp b/src/syndication/atom/person.cpp
index 013e326..7fafc99 100644
--- a/src/syndication/atom/person.cpp
+++ b/src/syndication/atom/person.cpp
@@ -41,20 +41,20 @@ Person::Person(const QDomElement &element) : ElementWrapper(element)
QString Person::name() const
{
return extractElementTextNS(atom1Namespace(),
- QLatin1String("name"));
+ QStringLiteral("name"));
}
QString Person::uri() const
{
return completeURI(extractElementTextNS(atom1Namespace(),
- QLatin1String("uri")));
+ QStringLiteral("uri")));
}
QString Person::email() const
{
return extractElementTextNS(atom1Namespace(),
- QLatin1String("email"));
+ QStringLiteral("email"));
}
QString Person::debugInfo() const
diff --git a/src/syndication/atom/source.cpp b/src/syndication/atom/source.cpp
index ae10927..3677d3b 100644
--- a/src/syndication/atom/source.cpp
+++ b/src/syndication/atom/source.cpp
@@ -51,7 +51,7 @@ QList<Person> Source::authors() const
{
QList<QDomElement> a =
elementsByTagNameNS(atom1Namespace(),
- QLatin1String("author"));
+ QStringLiteral("author"));
QList<Person> list;
list.reserve(a.count());
@@ -69,7 +69,7 @@ QList<Person> Source::contributors() const
{
QList<QDomElement> a =
elementsByTagNameNS(atom1Namespace(),
- QLatin1String("contributor"));
+ QStringLiteral("contributor"));
QList<Person> list;
list.reserve(a.count());
@@ -87,7 +87,7 @@ QList<Category> Source::categories() const
{
QList<QDomElement> a =
elementsByTagNameNS(atom1Namespace(),
- QLatin1String("category"));
+ QStringLiteral("category"));
QList<Category> list;
list.reserve(a.count());
@@ -104,26 +104,26 @@ QList<Category> Source::categories() const
Generator Source::generator() const
{
return Generator(firstElementByTagNameNS(atom1Namespace(),
- QLatin1String("generator")));
+ QStringLiteral("generator")));
}
QString Source::icon() const
{
return extractElementTextNS(atom1Namespace(),
- QLatin1String("icon"));
+ QStringLiteral("icon"));
}
QString Source::id() const
{
return extractElementTextNS(atom1Namespace(),
- QLatin1String("id"));
+ QStringLiteral("id"));
}
QList<Link> Source::links() const
{
QList<QDomElement> a =
elementsByTagNameNS(atom1Namespace(),
- QLatin1String("link"));
+ QStringLiteral("link"));
QList<Link> list;
list.reserve(a.count());
@@ -140,28 +140,28 @@ QList<Link> Source::links() const
QString Source::logo() const
{
return extractElementTextNS(atom1Namespace(),
- QLatin1String("logo"));
+ QStringLiteral("logo"));
}
QString Source::rights() const
{
- return extractAtomText(*this, QLatin1String("rights"));
+ return extractAtomText(*this, QStringLiteral("rights"));
}
QString Source::subtitle() const
{
- return extractAtomText(*this, QLatin1String("subtitle"));
+ return extractAtomText(*this, QStringLiteral("subtitle"));
}
QString Source::title() const
{
- return extractAtomText(*this, QLatin1String("title"));
+ return extractAtomText(*this, QStringLiteral("title"));
}
time_t Source::updated() const
{
QString upd = extractElementTextNS(atom1Namespace(),
- QLatin1String("updated"));
+ QStringLiteral("updated"));
return parseDate(upd, ISODate);
}
diff --git a/src/syndication/constants.cpp b/src/syndication/constants.cpp
index 89e9052..e9921c6 100644
--- a/src/syndication/constants.cpp
+++ b/src/syndication/constants.cpp
@@ -29,37 +29,37 @@ namespace Syndication
QString xmlNamespace()
{
- return QLatin1String("http://www.w3.org/XML/1998/namespace");
+ return QStringLiteral("http://www.w3.org/XML/1998/namespace");
}
QString xhtmlNamespace()
{
- return QLatin1String("http://www.w3.org/1999/xhtml");
+ return QStringLiteral("http://www.w3.org/1999/xhtml");
}
QString contentNameSpace()
{
- return QLatin1String("http://purl.org/rss/1.0/modules/content/");
+ return QStringLiteral("http://purl.org/rss/1.0/modules/content/");
}
QString dublinCoreNamespace()
{
- return QLatin1String("http://purl.org/dc/elements/1.1/");
+ return QStringLiteral("http://purl.org/dc/elements/1.1/");
}
QString itunesNamespace()
{
- return QLatin1String("http://www.itunes.com/dtds/podcast-1.0.dtd");
+ return QStringLiteral("http://www.itunes.com/dtds/podcast-1.0.dtd");
}
QString commentApiNamespace()
{
- return QLatin1String("http://wellformedweb.org/CommentAPI/");
+ return QStringLiteral("http://wellformedweb.org/CommentAPI/");
}
QString slashNamespace()
{
- return QLatin1String("http://purl.org/rss/1.0/modules/slash/");
+ return QStringLiteral("http://purl.org/rss/1.0/modules/slash/");
}
} // namespace Syndication
diff --git a/src/syndication/dataretriever.cpp b/src/syndication/dataretriever.cpp
index 18ebb6e..44acd7e 100644
--- a/src/syndication/dataretriever.cpp
+++ b/src/syndication/dataretriever.cpp
@@ -84,13 +84,13 @@ void FileRetriever::retrieveData(const QUrl &url)
QUrl u = url;
if (u.scheme() == QLatin1String("feed")) {
- u.setScheme(QLatin1String("http"));
+ u.setScheme(QStringLiteral("http"));
}
d->job = KIO::get(u, KIO::NoReload, KIO::HideProgressInfo);
- d->job->addMetaData(QLatin1String("UserAgent"), m_userAgent);
- d->job->addMetaData(QLatin1String("cache"), m_useCache ? QLatin1String("refresh") : QLatin1String("reload"));
+ d->job->addMetaData(QStringLiteral("UserAgent"), m_userAgent);
+ d->job->addMetaData(QStringLiteral("cache"), m_useCache ? QStringLiteral("refresh") : QStringLiteral("reload"));
QTimer::singleShot(1000 * 90, this, SLOT(slotTimeout()));
diff --git a/src/syndication/documentsource.cpp b/src/syndication/documentsource.cpp
index 0a76e05..82448bb 100644
--- a/src/syndication/documentsource.cpp
+++ b/src/syndication/documentsource.cpp
@@ -83,7 +83,7 @@ QDomDocument DocumentSource::asDomDocument() const
source.setData(d->array);
QXmlSimpleReader reader;
- reader.setFeature(QLatin1String("http://xml.org/sax/features/namespaces"), true);
+ reader.setFeature(QStringLiteral("http://xml.org/sax/features/namespaces"), true);
if (!d->domDoc.setContent(&source, &reader)) {
d->domDoc.clear();
diff --git a/src/syndication/elementwrapper.cpp b/src/syndication/elementwrapper.cpp
index 258a7d2..fce892f 100644
--- a/src/syndication/elementwrapper.cpp
+++ b/src/syndication/elementwrapper.cpp
@@ -109,8 +109,8 @@ QString ElementWrapper::xmlBase() const
*/
QStringList bases;
while (!current.isNull()) {
- if (current.hasAttributeNS(xmlNamespace(), QLatin1String("base"))) {
- bases << current.attributeNS(xmlNamespace(), QLatin1String("base"));
+ if (current.hasAttributeNS(xmlNamespace(), QStringLiteral("base"))) {
+ bases << current.attributeNS(xmlNamespace(), QStringLiteral("base"));
}
QDomNode parent = current.parentNode();
@@ -149,8 +149,8 @@ QString ElementWrapper::xmlLang() const
QDomElement current = d->element;
while (!current.isNull()) {
- if (current.hasAttributeNS(xmlNamespace(), QLatin1String("lang"))) {
- d->xmlLang = current.attributeNS(xmlNamespace(), QLatin1String("lang"));
+ if (current.hasAttributeNS(xmlNamespace(), QStringLiteral("lang"))) {
+ d->xmlLang = current.attributeNS(xmlNamespace(), QStringLiteral("lang"));
return d->xmlLang;
}
@@ -200,8 +200,8 @@ QString ElementWrapper::childNodesAsXML(const QDomElement &parent)
for (int i = 0; i < list.count(); ++i) {
QDomNode it = list.item(i);
if (!base.isEmpty() && it.isElement()
- && !it.toElement().hasAttributeNS(xmlNamespace(), QLatin1String("base"))) {
- it.toElement().setAttributeNS(xmlNamespace(), QLatin1String("base"), base);
+ && !it.toElement().hasAttributeNS(xmlNamespace(), QStringLiteral("base"))) {
+ it.toElement().setAttributeNS(xmlNamespace(), QStringLiteral("base"), base);
}
ts << it;
diff --git a/src/syndication/loader.cpp b/src/syndication/loader.cpp
index f5c58e5..0364521 100644
--- a/src/syndication/loader.cpp
+++ b/src/syndication/loader.cpp
@@ -160,7 +160,7 @@ void Loader::discoverFeeds(const QByteArray &data)
// "<[\\s]link[^>]*rel[\\s]=[\\s]\\\"[\\s]alternate[\\s]\\\"[^>]*>"
// "type[\\s]=[\\s]\\\"application/rss+xml\\\""
// "href[\\s]=[\\s]\\\"application/rss+xml\\\""
- QRegExp rx(QLatin1String("(?:REL)[^=]*=[^sAa]*(?:service.feed|ALTERNATE)[\\s]*[^s][^s](?:[^>]*)(?:HREF)[^=]*=[^A-Z0-9-_~,./$]*([^'\">\\s]*)"), Qt::CaseInsensitive);
+ QRegExp rx(QStringLiteral("(?:REL)[^=]*=[^sAa]*(?:service.feed|ALTERNATE)[\\s]*[^s][^s](?:[^>]*)(?:HREF)[^=]*=[^A-Z0-9-_~,./$]*([^'\">\\s]*)"), Qt::CaseInsensitive);
if (rx.indexIn(str) != -1) {
s2 = rx.cap(1);
} else {
@@ -168,7 +168,7 @@ void Loader::discoverFeeds(const QByteArray &data)
int pos = 0;
QStringList feeds;
QString host = d->url.host();
- rx.setPattern(QLatin1String("(?:<A )[^H]*(?:HREF)[^=]*=[^A-Z0-9-_~,./]*([^'\">\\s]*)"));
+ rx.setPattern(QStringLiteral("(?:<A )[^H]*(?:HREF)[^=]*=[^A-Z0-9-_~,./]*([^'\">\\s]*)"));
while (pos >= 0) {
pos = rx.indexIn(str, pos);
s2 = rx.cap(1);
diff --git a/src/syndication/mapper/enclosurerss2impl.cpp b/src/syndication/mapper/enclosurerss2impl.cpp
index 64ea665..f920c49 100644
--- a/src/syndication/mapper/enclosurerss2impl.cpp
+++ b/src/syndication/mapper/enclosurerss2impl.cpp
@@ -63,13 +63,13 @@ uint EnclosureRSS2Impl::length() const
uint EnclosureRSS2Impl::duration() const
{
- QString durStr = m_item.extractElementTextNS(itunesNamespace(), QLatin1String("duration"));
+ QString durStr = m_item.extractElementTextNS(itunesNamespace(), QStringLiteral("duration"));
if (durStr.isEmpty()) {
return 0;
}
- QStringList strTokens = durStr.split(QLatin1String(":"));
+ QStringList strTokens = durStr.split(QStringLiteral(":"));
QList<int> intTokens;
int count = strTokens.count();
diff --git a/src/syndication/mapper/itematomimpl.cpp b/src/syndication/mapper/itematomimpl.cpp
index 08e426b..8d2c88c 100644
--- a/src/syndication/mapper/itematomimpl.cpp
+++ b/src/syndication/mapper/itematomimpl.cpp
@@ -184,7 +184,7 @@ QList<Syndication::CategoryPtr> ItemAtomImpl::categories() const
int ItemAtomImpl::commentsCount() const
{
- QString cstr = m_entry.extractElementTextNS(slashNamespace(), QLatin1String("comments"));
+ QString cstr = m_entry.extractElementTextNS(slashNamespace(), QStringLiteral("comments"));
bool ok = false;
int comments = cstr.toInt(&ok);
return ok ? comments : -1;
@@ -197,12 +197,12 @@ QString ItemAtomImpl::commentsLink() const
QString ItemAtomImpl::commentsFeed() const
{
- return m_entry.extractElementTextNS(commentApiNamespace(), QLatin1String("commentRss"));
+ return m_entry.extractElementTextNS(commentApiNamespace(), QStringLiteral("commentRss"));
}
QString ItemAtomImpl::commentPostUri() const
{
- return m_entry.extractElementTextNS(commentApiNamespace(), QLatin1String("comment"));
+ return m_entry.extractElementTextNS(commentApiNamespace(), QStringLiteral("comment"));
}
Syndication::SpecificItemPtr ItemAtomImpl::specificItem() const
diff --git a/src/syndication/mapper/itemrss2impl.cpp b/src/syndication/mapper/itemrss2impl.cpp
index af6473b..b6f5143 100644
--- a/src/syndication/mapper/itemrss2impl.cpp
+++ b/src/syndication/mapper/itemrss2impl.cpp
@@ -110,7 +110,7 @@ time_t ItemRSS2Impl::datePublished() const
time_t ItemRSS2Impl::dateUpdated() const
{
//Some RSS feeds contain atom elements - return atom:dateUpdated if present
- const QString updstr = m_item.extractElementTextNS(Atom::atom1Namespace(), QLatin1String("updated"));
+ const QString updstr = m_item.extractElementTextNS(Atom::atom1Namespace(), QStringLiteral("updated"));
if (!updstr.isEmpty()) {
return parseDate(updstr, ISODate);
} else {
@@ -151,7 +151,7 @@ QList<Syndication::CategoryPtr> ItemRSS2Impl::categories() const
int ItemRSS2Impl::commentsCount() const
{
- QString cstr = m_item.extractElementTextNS(slashNamespace(), QLatin1String("comments"));
+ QString cstr = m_item.extractElementTextNS(slashNamespace(), QStringLiteral("comments"));
bool ok = false;
int comments = cstr.toInt(&ok);
return ok ? comments : -1;
@@ -164,16 +164,16 @@ QString ItemRSS2Impl::commentsLink() const
QString ItemRSS2Impl::commentsFeed() const
{
- QString t = m_item.extractElementTextNS(commentApiNamespace(), QLatin1String("commentRss"));
+ QString t = m_item.extractElementTextNS(commentApiNamespace(), QStringLiteral("commentRss"));
if (t.isNull()) {
- t = m_item.extractElementTextNS(commentApiNamespace(), QLatin1String("commentRSS"));
+ t = m_item.extractElementTextNS(commentApiNamespace(), QStringLiteral("commentRSS"));
}
return t;
}
QString ItemRSS2Impl::commentPostUri() const
{
- return m_item.extractElementTextNS(commentApiNamespace(), QLatin1String("comment"));
+ return m_item.extractElementTextNS(commentApiNamespace(), QStringLiteral("comment"));
}
Syndication::SpecificItemPtr ItemRSS2Impl::specificItem() const
diff --git a/src/syndication/rdf/contentvocab.cpp b/src/syndication/rdf/contentvocab.cpp
index b112e1b..5801f0a 100644
--- a/src/syndication/rdf/contentvocab.cpp
+++ b/src/syndication/rdf/contentvocab.cpp
@@ -49,7 +49,7 @@ ContentVocab *ContentVocab::ContentVocabPrivate::sSelf = 0;
ContentVocab::ContentVocab() : d(new ContentVocabPrivate)
{
- QString ns = QLatin1String("http://purl.org/rss/1.0/modules/content/");
+ QString ns = QStringLiteral("http://purl.org/rss/1.0/modules/content/");
d->namespaceURI = ns;
diff --git a/src/syndication/rdf/dublincorevocab.cpp b/src/syndication/rdf/dublincorevocab.cpp
index cfce672..b8a76b2 100644
--- a/src/syndication/rdf/dublincorevocab.cpp
+++ b/src/syndication/rdf/dublincorevocab.cpp
@@ -63,7 +63,7 @@ DublinCoreVocab *DublinCoreVocab::DublinCoreVocabPrivate::sSelf = 0;
DublinCoreVocab::DublinCoreVocab() : d(new DublinCoreVocabPrivate)
{
- QString ns = QLatin1String("http://purl.org/dc/elements/1.1/");
+ QString ns = QStringLiteral("http://purl.org/dc/elements/1.1/");
d->namespaceURI = ns;
diff --git a/src/syndication/rdf/modelmaker.cpp b/src/syndication/rdf/modelmaker.cpp
index f0fcc30..a96fbb3 100644
--- a/src/syndication/rdf/modelmaker.cpp
+++ b/src/syndication/rdf/modelmaker.cpp
@@ -61,8 +61,8 @@ Model ModelMaker::createFromXML(const QDomDocument &doc)
ResourcePtr ModelMaker::readResource(Model &model, const QDomElement &el)
{
- QString about = QLatin1String("about");
- QString resource = QLatin1String("resource");
+ QString about = QStringLiteral("about");
+ QString resource = QStringLiteral("resource");
ResourcePtr res;
diff --git a/src/syndication/rdf/parser.cpp b/src/syndication/rdf/parser.cpp
index 0d93364..a4fda6a 100644
--- a/src/syndication/rdf/parser.cpp
+++ b/src/syndication/rdf/parser.cpp
@@ -106,7 +106,7 @@ QDomDocument Parser::ParserPrivate::addEnumeration(const QDomDocument &docp)
QDomDocument doc(docp);
QDomNodeList list = doc.elementsByTagNameNS(RSS09Vocab::self()->namespaceURI(),
- QLatin1String("item"));
+ QStringLiteral("item"));
for (int i = 0; i < list.size(); ++i) {
QDomElement item = list.item(i).toElement();
@@ -207,8 +207,8 @@ void Parser::ParserPrivate::addSequenceFor09(Model model)
Parser::Parser() : d(new ParserPrivate)
{
- d->strInternalNs = QLatin1String("http://akregator.sf.net/libsyndication/internal#");
- d->strItemIndex = QLatin1String("itemIndex");
+ d->strInternalNs = QStringLiteral("http://akregator.sf.net/libsyndication/internal#");
+ d->strItemIndex = QStringLiteral("itemIndex");
}
Parser::~Parser()
@@ -224,7 +224,7 @@ Parser &Parser::operator=(const Parser & /*other*/)
QString Parser::format() const
{
- return QLatin1String("rdf");
+ return QStringLiteral("rdf");
}
} // namespace RDF
diff --git a/src/syndication/rdf/rdfvocab.cpp b/src/syndication/rdf/rdfvocab.cpp
index d3ca171..ab5d53d 100644
--- a/src/syndication/rdf/rdfvocab.cpp
+++ b/src/syndication/rdf/rdfvocab.cpp
@@ -62,7 +62,7 @@ RDFVocab *RDFVocab::self()
RDFVocab::RDFVocab() : d(new RDFVocabPrivate)
{
- QString ns = QLatin1String("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
+ QString ns = QStringLiteral("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
d->namespaceURI = ns;
diff --git a/src/syndication/rdf/rssvocab.cpp b/src/syndication/rdf/rssvocab.cpp
index d5494b5..1923892 100644
--- a/src/syndication/rdf/rssvocab.cpp
+++ b/src/syndication/rdf/rssvocab.cpp
@@ -59,7 +59,7 @@ RSSVocab *RSSVocab::RSSVocabPrivate::sSelf = 0;
RSSVocab::RSSVocab() : d(new RSSVocabPrivate)
{
- QString ns = QLatin1String("http://purl.org/rss/1.0/");
+ QString ns = QStringLiteral("http://purl.org/rss/1.0/");
d->namespaceURI = ns;
@@ -173,7 +173,7 @@ RSS09Vocab *RSS09Vocab::RSS09VocabPrivate::sSelf = 0;
RSS09Vocab::RSS09Vocab() : d(new RSS09VocabPrivate)
{
- QString ns = QLatin1String("http://my.netscape.com/rdf/simple/0.9/");
+ QString ns = QStringLiteral("http://my.netscape.com/rdf/simple/0.9/");
d->namespaceURI = ns;
diff --git a/src/syndication/rdf/syndicationinfo.cpp b/src/syndication/rdf/syndicationinfo.cpp
index 5e22b60..65cd163 100644
--- a/src/syndication/rdf/syndicationinfo.cpp
+++ b/src/syndication/rdf/syndicationinfo.cpp
@@ -92,15 +92,15 @@ QString SyndicationInfo::periodToString(Period period)
{
switch (period) {
case Daily:
- return QLatin1String("daily");
+ return QStringLiteral("daily");
case Hourly:
- return QLatin1String("hourly");
+ return QStringLiteral("hourly");
case Monthly:
- return QLatin1String("monthly");
+ return QStringLiteral("monthly");
case Weekly:
- return QLatin1String("weekly");
+ return QStringLiteral("weekly");
case Yearly:
- return QLatin1String("yearly");
+ return QStringLiteral("yearly");
default: // should never happen
return QString();
}
diff --git a/src/syndication/rdf/syndicationvocab.cpp b/src/syndication/rdf/syndicationvocab.cpp
index 6a1db3f..a00cf1f 100644
--- a/src/syndication/rdf/syndicationvocab.cpp
+++ b/src/syndication/rdf/syndicationvocab.cpp
@@ -51,7 +51,7 @@ SyndicationVocab *SyndicationVocab::SyndicationVocabPrivate::sSelf = 0;
SyndicationVocab::SyndicationVocab() : d(new SyndicationVocabPrivate)
{
- QString ns = QLatin1String("http://purl.org/rss/1.0/modules/syndication/");
+ QString ns = QStringLiteral("http://purl.org/rss/1.0/modules/syndication/");
d->namespaceURI = ns;
diff --git a/src/syndication/rss2/category.cpp b/src/syndication/rss2/category.cpp
index f415ab7..b08ccd5 100644
--- a/src/syndication/rss2/category.cpp
+++ b/src/syndication/rss2/category.cpp
@@ -44,7 +44,7 @@ QString Category::category() const
QString Category::domain() const
{
- return attribute(QLatin1String("domain"));
+ return attribute(QStringLiteral("domain"));
}
QString Category::debugInfo() const
diff --git a/src/syndication/rss2/cloud.cpp b/src/syndication/rss2/cloud.cpp
index 32150ef..79c7e25 100644
--- a/src/syndication/rss2/cloud.cpp
+++ b/src/syndication/rss2/cloud.cpp
@@ -39,14 +39,14 @@ Cloud::Cloud(const QDomElement &element) : ElementWrapper(element)
QString Cloud::domain() const
{
- return attribute(QLatin1String("domain"));
+ return attribute(QStringLiteral("domain"));
}
int Cloud::port() const
{
- if (hasAttribute(QLatin1String("port"))) {
+ if (hasAttribute(QStringLiteral("port"))) {
bool ok;
- int c = attribute(QLatin1String("port")).toInt(&ok);
+ int c = attribute(QStringLiteral("port")).toInt(&ok);
return ok ? c : -1;
}
@@ -55,18 +55,18 @@ int Cloud::port() const
QString Cloud::path() const
{
- return attribute(QLatin1String("path"));
+ return attribute(QStringLiteral("path"));
}
QString Cloud::registerProcedure() const
{
- return attribute(QLatin1String("registerProcedure"));
+ return attribute(QStringLiteral("registerProcedure"));
}
QString Cloud::protocol() const
{
- return attribute(QLatin1String("protocol"));
+ return attribute(QStringLiteral("protocol"));
}
QString Cloud::debugInfo() const
diff --git a/src/syndication/rss2/document.cpp b/src/syndication/rss2/document.cpp
index dfd032e..dc8913f 100644
--- a/src/syndication/rss2/document.cpp
+++ b/src/syndication/rss2/document.cpp
@@ -67,7 +67,7 @@ Document::Document(const QDomElement &element) : SpecificDocument(),
Document Document::fromXML(const QDomDocument &doc)
{
- QDomNode channelNode = doc.namedItem(QLatin1String("rss")).namedItem(QLatin1String("channel"));
+ QDomNode channelNode = doc.namedItem(QStringLiteral("rss")).namedItem(QStringLiteral("channel"));
return Document(channelNode.toElement());
}
@@ -98,30 +98,30 @@ bool Document::isValid() const
QString Document::title() const
{
- return extractElementTextNS(QString(), QLatin1String("title"));
+ return extractElementTextNS(QString(), QStringLiteral("title"));
}
QString Document::link() const
{
- return extractElementTextNS(QString(), QLatin1String("link"));
+ return extractElementTextNS(QString(), QStringLiteral("link"));
}
QString Document::description() const
{
- QString desc = extractElementTextNS(QString(), QLatin1String("description"));
+ QString desc = extractElementTextNS(QString(), QStringLiteral("description"));
return normalize(desc);
}
QString Document::language() const
{
QString lang = extractElementTextNS(QString(),
- QLatin1String("language"));
+ QStringLiteral("language"));
if (!lang.isNull()) {
return lang;
} else {
return extractElementTextNS(
- dublinCoreNamespace(), QLatin1String("language"));
+ dublinCoreNamespace(), QStringLiteral("language"));
}
}
@@ -129,42 +129,42 @@ QString Document::language() const
QString Document::copyright() const
{
QString rights = extractElementTextNS(QString(),
- QLatin1String("copyright"));
+ QStringLiteral("copyright"));
if (!rights.isNull()) {
return rights;
} else {
// if <copyright> is not provided, use <dc:rights>
return extractElementTextNS(dublinCoreNamespace(),
- QLatin1String("rights"));
+ QStringLiteral("rights"));
}
}
QString Document::managingEditor() const
{
- return extractElementTextNS(QString(), QLatin1String("managingEditor"));
+ return extractElementTextNS(QString(), QStringLiteral("managingEditor"));
}
QString Document::webMaster() const
{
- return extractElementTextNS(QString(), QLatin1String("webMaster"));
+ return extractElementTextNS(QString(), QStringLiteral("webMaster"));
}
time_t Document::pubDate() const
{
- QString str = extractElementTextNS(QString(), QLatin1String("pubDate"));
+ QString str = extractElementTextNS(QString(), QStringLiteral("pubDate"));
if (!str.isNull()) {
return parseDate(str, RFCDate);
} else {
// if there is no pubDate, check for dc:date
- str = extractElementTextNS(dublinCoreNamespace(), QLatin1String("date"));
+ str = extractElementTextNS(dublinCoreNamespace(), QStringLiteral("date"));
return parseDate(str, ISODate);
}
}
time_t Document::lastBuildDate() const
{
- QString str = extractElementTextNS(QString(), QLatin1String("lastBuildDate"));
+ QString str = extractElementTextNS(QString(), QStringLiteral("lastBuildDate"));
return parseDate(str, RFCDate);
}
@@ -174,7 +174,7 @@ QList<Category> Document::categories() const
QList<Category> categories;
QList<QDomElement> catNodes = elementsByTagNameNS(QString(),
- QLatin1String("category"));
+ QStringLiteral("category"));
categories.reserve(catNodes.count());
QList<QDomElement>::ConstIterator it = catNodes.constBegin();
for (; it != catNodes.constEnd(); ++it) {
@@ -186,17 +186,17 @@ QList<Category> Document::categories() const
QString Document::generator() const
{
- return extractElementTextNS(QString(), QLatin1String("generator"));
+ return extractElementTextNS(QString(), QStringLiteral("generator"));
}
QString Document::docs() const
{
- return extractElementTextNS(QString(), QLatin1String("docs"));
+ return extractElementTextNS(QString(), QStringLiteral("docs"));
}
Cloud Document::cloud() const
{
- return Cloud(firstElementByTagNameNS(QString(), QLatin1String("cloud")));
+ return Cloud(firstElementByTagNameNS(QString(), QStringLiteral("cloud")));
}
int Document::ttl() const
@@ -204,39 +204,39 @@ int Document::ttl() const
bool ok;
int c;
- QString text = extractElementTextNS(QString(), QLatin1String("ttl"));
+ QString text = extractElementTextNS(QString(), QStringLiteral("ttl"));
c = text.toInt(&ok);
return ok ? c : 0;
}
Image Document::image() const
{
- return Image(firstElementByTagNameNS(QString(), QLatin1String("image")));
+ return Image(firstElementByTagNameNS(QString(), QStringLiteral("image")));
}
TextInput Document::textInput() const
{
- TextInput ti = TextInput(firstElementByTagNameNS(QString(), QLatin1String("textInput")));
+ TextInput ti = TextInput(firstElementByTagNameNS(QString(), QStringLiteral("textInput")));
if (!ti.isNull()) {
return ti;
}
// Netscape's version of RSS 0.91 has textinput, not textInput
- return TextInput(firstElementByTagNameNS(QString(), QLatin1String("textinput")));
+ return TextInput(firstElementByTagNameNS(QString(), QStringLiteral("textinput")));
}
QSet<int> Document::skipHours() const
{
QSet<int> skipHours;
QDomElement skipHoursNode = firstElementByTagNameNS(QString(),
- QLatin1String("skipHours"));
+ QStringLiteral("skipHours"));
if (!skipHoursNode.isNull()) {
ElementWrapper skipHoursWrapper(skipHoursNode);
bool ok = false;
QList<QDomElement> hours =
skipHoursWrapper.elementsByTagNameNS(QString(),
- QLatin1String("hour"));
+ QStringLiteral("hour"));
QList<QDomElement>::ConstIterator it = hours.constBegin();
for (; it != hours.constEnd(); ++it) {
int h = (*it).text().toInt(&ok);
@@ -252,20 +252,20 @@ QSet<int> Document::skipHours() const
QSet<Document::DayOfWeek> Document::skipDays() const
{
QSet<DayOfWeek> skipDays;
- QDomElement skipDaysNode = firstElementByTagNameNS(QString(), QLatin1String("skipDays"));
+ QDomElement skipDaysNode = firstElementByTagNameNS(QString(), QStringLiteral("skipDays"));
if (!skipDaysNode.isNull()) {
ElementWrapper skipDaysWrapper(skipDaysNode);
QHash<QString, DayOfWeek> weekDays;
- weekDays[QLatin1String("Monday")] = Monday;
- weekDays[QLatin1String("Tuesday")] = Tuesday;
- weekDays[QLatin1String("Wednesday")] = Wednesday;
- weekDays[QLatin1String("Thursday")] = Thursday;
- weekDays[QLatin1String("Friday")] = Friday;
- weekDays[QLatin1String("Saturday")] = Saturday;
- weekDays[QLatin1String("Sunday")] = Sunday;
+ weekDays[QStringLiteral("Monday")] = Monday;
+ weekDays[QStringLiteral("Tuesday")] = Tuesday;
+ weekDays[QStringLiteral("Wednesday")] = Wednesday;
+ weekDays[QStringLiteral("Thursday")] = Thursday;
+ weekDays[QStringLiteral("Friday")] = Friday;
+ weekDays[QStringLiteral("Saturday")] = Saturday;
+ weekDays[QStringLiteral("Sunday")] = Sunday;
- QList<QDomElement> days = skipDaysWrapper.elementsByTagNameNS(QString(), QLatin1String("day"));
+ QList<QDomElement> days = skipDaysWrapper.elementsByTagNameNS(QString(), QStringLiteral("day"));
for (QList<QDomElement>::ConstIterator it = days.constBegin(); it != days.constEnd(); ++it) {
if (weekDays.contains((*it).text())) {
skipDays.insert(weekDays[(*it).text()]);
@@ -280,7 +280,7 @@ QList<Item> Document::items() const
{
QList<Item> items;
- QList<QDomElement> itemNodes = elementsByTagNameNS(QString(), QLatin1String("item"));
+ QList<QDomElement> itemNodes = elementsByTagNameNS(QString(), QStringLiteral("item"));
DocumentPtr doccpy(new Document(*this));
items.reserve(itemNodes.count());
@@ -297,28 +297,28 @@ QList<QDomElement> Document::unhandledElements() const
static QList<ElementType> handled;
if (handled.isEmpty()) {
handled.reserve(22);
- handled.append(ElementType(QLatin1String("title")));
- handled.append(ElementType(QLatin1String("link")));
- handled.append(ElementType(QLatin1String("description")));
- handled.append(ElementType(QLatin1String("language")));
- handled.append(ElementType(QLatin1String("copyright")));
- handled.append(ElementType(QLatin1String("managingEditor")));
- handled.append(ElementType(QLatin1String("webMaster")));
- handled.append(ElementType(QLatin1String("pubDate")));
- handled.append(ElementType(QLatin1String("lastBuildDate")));
- handled.append(ElementType(QLatin1String("skipDays")));
- handled.append(ElementType(QLatin1String("skipHours")));
- handled.append(ElementType(QLatin1String("item")));
- handled.append(ElementType(QLatin1String("textinput")));
- handled.append(ElementType(QLatin1String("textInput")));
- handled.append(ElementType(QLatin1String("image")));
- handled.append(ElementType(QLatin1String("ttl")));
- handled.append(ElementType(QLatin1String("generator")));
- handled.append(ElementType(QLatin1String("docs")));
- handled.append(ElementType(QLatin1String("cloud")));
- handled.append(ElementType(QLatin1String("language"), dublinCoreNamespace()));
- handled.append(ElementType(QLatin1String("rights"), dublinCoreNamespace()));
- handled.append(ElementType(QLatin1String("date"), dublinCoreNamespace()));
+ handled.append(ElementType(QStringLiteral("title")));
+ handled.append(ElementType(QStringLiteral("link")));
+ handled.append(ElementType(QStringLiteral("description")));
+ handled.append(ElementType(QStringLiteral("language")));
+ handled.append(ElementType(QStringLiteral("copyright")));
+ handled.append(ElementType(QStringLiteral("managingEditor")));
+ handled.append(ElementType(QStringLiteral("webMaster")));
+ handled.append(ElementType(QStringLiteral("pubDate")));
+ handled.append(ElementType(QStringLiteral("lastBuildDate")));
+ handled.append(ElementType(QStringLiteral("skipDays")));
+ handled.append(ElementType(QStringLiteral("skipHours")));
+ handled.append(ElementType(QStringLiteral("item")));
+ handled.append(ElementType(QStringLiteral("textinput")));
+ handled.append(ElementType(QStringLiteral("textInput")));
+ handled.append(ElementType(QStringLiteral("image")));
+ handled.append(ElementType(QStringLiteral("ttl")));
+ handled.append(ElementType(QStringLiteral("generator")));
+ handled.append(ElementType(QStringLiteral("docs")));
+ handled.append(ElementType(QStringLiteral("cloud")));
+ handled.append(ElementType(QStringLiteral("language"), dublinCoreNamespace()));
+ handled.append(ElementType(QStringLiteral("rights"), dublinCoreNamespace()));
+ handled.append(ElementType(QStringLiteral("date"), dublinCoreNamespace()));
}
QList<QDomElement> notHandled;
@@ -405,7 +405,7 @@ void Document::getItemTitleFormatInfo(bool *isCDATA, bool *containsMarkup) const
return;
}
- QDomElement titleEl = (*litems.begin()).firstElementByTagNameNS(QString(), QLatin1String("title"));
+ QDomElement titleEl = (*litems.begin()).firstElementByTagNameNS(QString(), QStringLiteral("title"));
d->itemTitleIsCDATA = titleEl.firstChild().isCDATASection();
int nmax = litems.size() < 10 ? litems.size() : 10; // we check a maximum of 10 items
@@ -442,7 +442,7 @@ void Document::getItemDescriptionFormatInfo(bool *isCDATA, bool *containsMarkup)
return;
}
- QDomElement descEl = (*litems.begin()).firstElementByTagNameNS(QString(), QLatin1String("description"));
+ QDomElement descEl = (*litems.begin()).firstElementByTagNameNS(QString(), QStringLiteral("description"));
d->itemDescriptionIsCDATA = descEl.firstChild().isCDATASection();
int nmax = litems.size() < 10 ? litems.size() : 10; // we check a maximum of 10 items
diff --git a/src/syndication/rss2/enclosure.cpp b/src/syndication/rss2/enclosure.cpp
index 58b3adf..ab410b8 100644
--- a/src/syndication/rss2/enclosure.cpp
+++ b/src/syndication/rss2/enclosure.cpp
@@ -37,16 +37,16 @@ Enclosure::Enclosure(const QDomElement &element) : ElementWrapper(element)
QString Enclosure::url() const
{
- return attribute(QLatin1String("url"));
+ return attribute(QStringLiteral("url"));
}
int Enclosure::length() const
{
int length = 0;
- if (hasAttribute(QLatin1String("length"))) {
+ if (hasAttribute(QStringLiteral("length"))) {
bool ok;
- int c = attribute(QLatin1String("length")).toInt(&ok);
+ int c = attribute(QStringLiteral("length")).toInt(&ok);
length = ok ? c : 0;
}
return length;
@@ -54,7 +54,7 @@ int Enclosure::length() const
QString Enclosure::type() const
{
- return attribute(QLatin1String("type"));
+ return attribute(QStringLiteral("type"));
}
QString Enclosure::debugInfo() const
diff --git a/src/syndication/rss2/image.cpp b/src/syndication/rss2/image.cpp
index 82e83bd..1f5e7d1 100644
--- a/src/syndication/rss2/image.cpp
+++ b/src/syndication/rss2/image.cpp
@@ -39,18 +39,18 @@ Image::Image(const QDomElement &element) : ElementWrapper(element)
QString Image::url() const
{
- return extractElementTextNS(QString(), QLatin1String("url"));
+ return extractElementTextNS(QString(), QStringLiteral("url"));
}
QString Image::title() const
{
- return extractElementTextNS(QString(), QLatin1String("title"));
+ return extractElementTextNS(QString(), QStringLiteral("title"));
}
QString Image::link() const
{
- return extractElementTextNS(QString(), QLatin1String("link"));
+ return extractElementTextNS(QString(), QStringLiteral("link"));
}
@@ -60,7 +60,7 @@ uint Image::width() const
bool ok;
uint c;
- text = extractElementTextNS(QString(), QLatin1String("width"));
+ text = extractElementTextNS(QString(), QStringLiteral("width"));
c = text.toUInt(&ok);
return ok ? c : 88; // set to default if not parsable
}
@@ -71,14 +71,14 @@ uint Image::height() const
bool ok;
uint c;
- text = extractElementTextNS(QString(), QLatin1String("height"));
+ text = extractElementTextNS(QString(), QStringLiteral("height"));
c = text.toUInt(&ok);
return ok ? c : 31; // set to default if not parsable
}
QString Image::description() const
{
- return extractElementTextNS(QString(), QLatin1String("description"));
+ return extractElementTextNS(QString(), QStringLiteral("description"));
}
QString Image::debugInfo() const
diff --git a/src/syndication/rss2/item.cpp b/src/syndication/rss2/item.cpp
index 7d4a4f2..df6ae25 100644
--- a/src/syndication/rss2/item.cpp
+++ b/src/syndication/rss2/item.cpp
@@ -88,17 +88,17 @@ QString Item::title() const
QString Item::originalDescription() const
{
- return extractElementTextNS(QString(), QLatin1String("description"));
+ return extractElementTextNS(QString(), QStringLiteral("description"));
}
QString Item::originalTitle() const
{
- return extractElementTextNS(QString(), QLatin1String("title"));
+ return extractElementTextNS(QString(), QStringLiteral("title"));
}
QString Item::link() const
{
- QString url = extractElementTextNS(QString(), QLatin1String("link"));
+ QString url = extractElementTextNS(QString(), QStringLiteral("link"));
if (url.startsWith(QLatin1String("http://")) || url.startsWith(QLatin1String("https://"))) {
return url;
}
@@ -140,7 +140,7 @@ QString Item::content() const
QList<Category> Item::categories() const
{
QList<QDomElement> cats = elementsByTagNameNS(QString(),
- QLatin1String("category"));
+ QStringLiteral("category"));
QList<Category> categories;
categories.reserve(cats.count());
@@ -154,18 +154,18 @@ QList<Category> Item::categories() const
QString Item::comments() const
{
- return extractElementTextNS(QString(), QLatin1String("comments"));
+ return extractElementTextNS(QString(), QStringLiteral("comments"));
}
QString Item::author() const
{
- QString a = extractElementTextNS(QString(), QLatin1String("author"));
+ QString a = extractElementTextNS(QString(), QStringLiteral("author"));
if (!a.isNull()) {
return a;
} else {
// if author is not available, fall back to dc:creator
return extractElementTextNS(dublinCoreNamespace(),
- QLatin1String("creator"));
+ QStringLiteral("creator"));
}
}
@@ -173,7 +173,7 @@ QString Item::author() const
QList<Enclosure> Item::enclosures() const
{
QList<QDomElement> encs = elementsByTagNameNS(QString(),
- QLatin1String("enclosure"));
+ QStringLiteral("enclosure"));
QList<Enclosure> enclosures;
enclosures.reserve(encs.count());
@@ -187,7 +187,7 @@ QList<Enclosure> Item::enclosures() const
QString Item::guid() const
{
- return extractElementTextNS(QString(), QLatin1String("guid"));
+ return extractElementTextNS(QString(), QStringLiteral("guid"));
}
bool Item::guidIsPermaLink() const
@@ -195,9 +195,9 @@ bool Item::guidIsPermaLink() const
bool guidIsPermaLink = true; // true is default
QDomElement guidNode = firstElementByTagNameNS(QString(),
- QLatin1String("guid"));
+ QStringLiteral("guid"));
if (!guidNode.isNull()) {
- if (guidNode.attribute(QLatin1String("isPermaLink"))
+ if (guidNode.attribute(QStringLiteral("isPermaLink"))
== QLatin1String("false")) {
guidIsPermaLink = false;
}
@@ -208,31 +208,31 @@ bool Item::guidIsPermaLink() const
time_t Item::pubDate() const
{
- QString str = extractElementTextNS(QString(), QLatin1String("pubDate"));
+ QString str = extractElementTextNS(QString(), QStringLiteral("pubDate"));
if (!str.isNull()) {
return parseDate(str, RFCDate);
}
// if there is no pubDate, check for dc:date
- str = extractElementTextNS(dublinCoreNamespace(), QLatin1String("date"));
+ str = extractElementTextNS(dublinCoreNamespace(), QStringLiteral("date"));
return parseDate(str, ISODate);
}
time_t Item::expirationDate() const
{
- QString str = extractElementTextNS(QString(), QLatin1String("expirationDate"));
+ QString str = extractElementTextNS(QString(), QStringLiteral("expirationDate"));
return parseDate(str, RFCDate);
}
Source Item::source() const
{
- return Source(firstElementByTagNameNS(QString(), QLatin1String("source")));
+ return Source(firstElementByTagNameNS(QString(), QStringLiteral("source")));
}
QString Item::rating() const
{
- return extractElementTextNS(QString(), QLatin1String("rating"));
+ return extractElementTextNS(QString(), QStringLiteral("rating"));
}
QString Item::debugInfo() const
@@ -290,17 +290,17 @@ QList<QDomElement> Item::unhandledElements() const
static QList<ElementType> handled;
if (handled.isEmpty()) {
handled.reserve(11);
- handled.append(ElementType(QLatin1String("title")));
- handled.append(ElementType(QLatin1String("link")));
- handled.append(ElementType(QLatin1String("description")));
- handled.append(ElementType(QLatin1String("pubDate")));
- handled.append(ElementType(QLatin1String("expirationDate")));
- handled.append(ElementType(QLatin1String("rating")));
- handled.append(ElementType(QLatin1String("source")));
- handled.append(ElementType(QLatin1String("guid")));
- handled.append(ElementType(QLatin1String("comments")));
- handled.append(ElementType(QLatin1String("author")));
- handled.append(ElementType(QLatin1String("date"), dublinCoreNamespace()));
+ handled.append(ElementType(QStringLiteral("title")));
+ handled.append(ElementType(QStringLiteral("link")));
+ handled.append(ElementType(QStringLiteral("description")));
+ handled.append(ElementType(QStringLiteral("pubDate")));
+ handled.append(ElementType(QStringLiteral("expirationDate")));
+ handled.append(ElementType(QStringLiteral("rating")));
+ handled.append(ElementType(QStringLiteral("source")));
+ handled.append(ElementType(QStringLiteral("guid")));
+ handled.append(ElementType(QStringLiteral("comments")));
+ handled.append(ElementType(QStringLiteral("author")));
+ handled.append(ElementType(QStringLiteral("date"), dublinCoreNamespace()));
}
QList<QDomElement> notHandled;
diff --git a/src/syndication/rss2/parser.cpp b/src/syndication/rss2/parser.cpp
index 6c5c3f7..47773a4 100644
--- a/src/syndication/rss2/parser.cpp
+++ b/src/syndication/rss2/parser.cpp
@@ -43,7 +43,7 @@ bool Parser::accept(const Syndication::DocumentSource &source) const
return false;
}
- QDomNode root = doc.namedItem(QLatin1String("rss")).toElement();
+ QDomNode root = doc.namedItem(QStringLiteral("rss")).toElement();
return !root.isNull();
}
@@ -55,7 +55,7 @@ Syndication::SpecificDocumentPtr Parser::parse(const DocumentSource &source) con
QString Parser::format() const
{
- return QLatin1String("rss2");
+ return QStringLiteral("rss2");
}
Parser::Parser()
diff --git a/src/syndication/rss2/source.cpp b/src/syndication/rss2/source.cpp
index 04dd914..f4d5eb0 100644
--- a/src/syndication/rss2/source.cpp
+++ b/src/syndication/rss2/source.cpp
@@ -45,7 +45,7 @@ QString Source::source() const
QString Source::url() const
{
- return attribute(QLatin1String("url"));
+ return attribute(QStringLiteral("url"));
}
QString Source::debugInfo() const
diff --git a/src/syndication/rss2/textinput.cpp b/src/syndication/rss2/textinput.cpp
index f446930..c0427c5 100644
--- a/src/syndication/rss2/textinput.cpp
+++ b/src/syndication/rss2/textinput.cpp
@@ -40,22 +40,22 @@ TextInput::TextInput(const QDomElement &element) : ElementWrapper(element)
QString TextInput::title() const
{
- return extractElementTextNS(QString(), QLatin1String("title"));
+ return extractElementTextNS(QString(), QStringLiteral("title"));
}
QString TextInput::name() const
{
- return extractElementTextNS(QString(), QLatin1String("name"));
+ return extractElementTextNS(QString(), QStringLiteral("name"));
}
QString TextInput::description() const
{
- return extractElementTextNS(QString(), QLatin1String("description"));
+ return extractElementTextNS(QString(), QStringLiteral("description"));
}
QString TextInput::link() const
{
- return extractElementTextNS(QString(), QLatin1String("link"));
+ return extractElementTextNS(QString(), QStringLiteral("link"));
}
diff --git a/src/syndication/rss2/tools_p.cpp b/src/syndication/rss2/tools_p.cpp
index 0cecaa8..a743f1d 100644
--- a/src/syndication/rss2/tools_p.cpp
+++ b/src/syndication/rss2/tools_p.cpp
@@ -39,19 +39,19 @@ QString extractContent(const ElementWrapper &wrapper)
return QString();
}
- QList<QDomElement> list = wrapper.elementsByTagNameNS(contentNameSpace(), QLatin1String("encoded"));
+ QList<QDomElement> list = wrapper.elementsByTagNameNS(contentNameSpace(), QStringLiteral("encoded"));
if (!list.isEmpty()) {
return list.first().text().trimmed();
}
- list = wrapper.elementsByTagNameNS(xhtmlNamespace(), QLatin1String("body"));
+ list = wrapper.elementsByTagNameNS(xhtmlNamespace(), QStringLiteral("body"));
if (!list.isEmpty()) {
return ElementWrapper::childNodesAsXML(list.first()).trimmed();
}
- list = wrapper.elementsByTagNameNS(xhtmlNamespace(), QLatin1String("div"));
+ list = wrapper.elementsByTagNameNS(xhtmlNamespace(), QStringLiteral("div"));
if (!list.isEmpty()) {
return ElementWrapper::childNodesAsXML(list.first()).trimmed();
diff --git a/src/syndication/tools.cpp b/src/syndication/tools.cpp
index 6a6ab7c..ffe7227 100644
--- a/src/syndication/tools.cpp
+++ b/src/syndication/tools.cpp
@@ -104,7 +104,7 @@ QString dateTimeToString(uint date)
return QString();
}
- const QString format = QLatin1String("ddd MMM d HH:mm:ss yyyy");
+ const QString format = QStringLiteral("ddd MMM d HH:mm:ss yyyy");
QDateTime dt;
dt.setTime_t(date);
return dt.toUTC().toString(format);
@@ -155,7 +155,7 @@ QString htmlToPlainText(const QString &html)
{
QString str(html);
//TODO: preserve some formatting, such as line breaks
- str.remove(QRegExp(QLatin1String("<[^>]*>"))); // remove tags
+ str.remove(QRegExp(QStringLiteral("<[^>]*>"))); // remove tags
str = resolveEntities(str);
return str.trimmed();
}
@@ -169,7 +169,7 @@ static bool tagRegExpSet = false;
bool stringContainsMarkup(const QString &str)
{
//check for entities
- if (str.contains(QRegExp(QLatin1String("&[a-zA-Z0-9#]+;")))) {
+ if (str.contains(QRegExp(QStringLiteral("&[a-zA-Z0-9#]+;")))) {
return true;
}
@@ -179,7 +179,7 @@ bool stringContainsMarkup(const QString &str)
}
if (!tagRegExpSet) {
- tagRegExp = QRegExp(QLatin1String("<\\w+.*/?>"));
+ tagRegExp = QRegExp(QStringLiteral("<\\w+.*/?>"));
tagRegExpSet = true;
}
return str.contains(tagRegExp);
@@ -188,7 +188,7 @@ bool stringContainsMarkup(const QString &str)
bool isHtml(const QString &str)
{
//check for entities
- if (str.contains(QRegExp(QLatin1String("&[a-zA-Z0-9#]+;")))) {
+ if (str.contains(QRegExp(QStringLiteral("&[a-zA-Z0-9#]+;")))) {
return true;
}
@@ -198,7 +198,7 @@ bool isHtml(const QString &str)
}
if (!tagRegExpSet) {
- tagRegExp = QRegExp(QLatin1String("<\\w+.*/?>"));
+ tagRegExp = QRegExp(QStringLiteral("<\\w+.*/?>"));
tagRegExpSet = true;
}
if (str.contains(tagRegExp)) {
@@ -247,7 +247,7 @@ PersonPtr personFromString(const QString &strp)
// look for something looking like a mail address ("[email protected]",
// "<[email protected]>") and extract it
- QRegExp remail(QLatin1String("<?([^@\\s<][email protected][^>\\s]+)>?")); // FIXME: user "proper" regexp,
+ QRegExp remail(QStringLiteral("<?([^@\\s<][email protected][^>\\s]+)>?")); // FIXME: user "proper" regexp,
// search kmail source for it
int pos = remail.indexIn(str);
@@ -258,8 +258,8 @@ PersonPtr personFromString(const QString &strp)
}
// replace "mailto", "(", ")" (to be extended)
- email.remove(QLatin1String("mailto:"));
- email.remove(QRegExp(QLatin1String("[\\(\\)]")));
+ email.remove(QStringLiteral("mailto:"));
+ email.remove(QRegExp(QStringLiteral("[\\(\\)]")));
// simplify the rest and use it as name
@@ -271,7 +271,7 @@ PersonPtr personFromString(const QString &strp)
// str is of the format "Foo M. Bar (President)",
// we should not cut anything.
- QRegExp rename(QLatin1String("^\\(([^\\)]*)\\)"));
+ QRegExp rename(QStringLiteral("^\\(([^\\)]*)\\)"));
if (rename.exactMatch(name)) {
name = rename.cap(1);