Remove remaining QBT_USES_QT5 defines.

Fixup of e64bb1de8c.
This commit is contained in:
Chocobo1 2017-03-06 23:45:34 +08:00
parent fc49856857
commit 7539bee5c5
4 changed files with 0 additions and 50 deletions

View file

@ -159,12 +159,7 @@ QString Utils::String::fromStdString(const std::string &str)
std::string Utils::String::toStdString(const QString &str)
{
#ifdef QBT_USES_QT5
return str.toStdString();
#else
QByteArray utf8 = str.toUtf8();
return std::string(utf8.constData(), utf8.length());
#endif
}
// to send numbers instead of strings with suffixes
@ -196,26 +191,5 @@ bool Utils::String::slowEquals(const QByteArray &a, const QByteArray &b)
QString Utils::String::toHtmlEscaped(const QString &str)
{
#ifdef QBT_USES_QT5
return str.toHtmlEscaped();
#else
// code from Qt
QString rich;
const int len = str.length();
rich.reserve(int(len * 1.1));
for (int i = 0; i < len; ++i) {
if (str.at(i) == QLatin1Char('<'))
rich += QLatin1String("&lt;");
else if (str.at(i) == QLatin1Char('>'))
rich += QLatin1String("&gt;");
else if (str.at(i) == QLatin1Char('&'))
rich += QLatin1String("&amp;");
else if (str.at(i) == QLatin1Char('"'))
rich += QLatin1String("&quot;");
else
rich += str.at(i);
}
rich.squeeze();
return rich;
#endif
}