Browse Source

Merge pull request #14736 from glassez/string-compare

Enclose strings in QLatin1String
adaptive-webui-19844
Vladimir Golovnev 4 years ago committed by GitHub
parent
commit
f97aa05bdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/base/rss/rss_parser.cpp
  2. 10
      src/gui/programupdater.cpp

6
src/base/rss/rss_parser.cpp

@ -563,12 +563,12 @@ void Parser::parse_impl(const QByteArray &feedData) @@ -563,12 +563,12 @@ void Parser::parse_impl(const QByteArray &feedData)
while (xml.readNextStartElement())
{
if (xml.name() == "rss")
if (xml.name() == QLatin1String("rss"))
{
// Find channels
while (xml.readNextStartElement())
{
if (xml.name() == "channel")
if (xml.name() == QLatin1String("channel"))
{
parseRSSChannel(xml);
foundChannel = true;
@ -580,7 +580,7 @@ void Parser::parse_impl(const QByteArray &feedData) @@ -580,7 +580,7 @@ void Parser::parse_impl(const QByteArray &feedData)
}
break;
}
if (xml.name() == "feed")
if (xml.name() == QLatin1String("feed"))
{ // Atom feed
parseAtomChannel(xml);
foundChannel = true;

10
src/gui/programupdater.cpp

@ -127,18 +127,18 @@ void ProgramUpdater::rssDownloadFinished(const Net::DownloadResult &result) @@ -127,18 +127,18 @@ void ProgramUpdater::rssDownloadFinished(const Net::DownloadResult &result)
if (xml.isStartElement())
{
if (xml.name() == "item")
if (xml.name() == QLatin1String("item"))
inItem = true;
else if (inItem && xml.name() == "link")
else if (inItem && (xml.name() == QLatin1String("link")))
updateLink = getStringValue(xml);
else if (inItem && xml.name() == "type")
else if (inItem && (xml.name() == QLatin1String("type")))
type = getStringValue(xml);
else if (inItem && xml.name() == "version")
else if (inItem && (xml.name() == QLatin1String("version")))
version = getStringValue(xml);
}
else if (xml.isEndElement())
{
if (inItem && xml.name() == "item")
if (inItem && (xml.name() == QLatin1String("item")))
{
if (type.compare(OS_TYPE, Qt::CaseInsensitive) == 0)
{

Loading…
Cancel
Save