kdevplatform/language: use QLatin1String overload with QString::replace

GIT_SILENT
parent 21aefbc1
...@@ -280,19 +280,19 @@ QString reverse(const QString& str) ...@@ -280,19 +280,19 @@ QString reverse(const QString& str)
///@todo this hackery sucks ///@todo this hackery sucks
QString escapeForBracketMatching(QString str) QString escapeForBracketMatching(QString str)
{ {
str.replace(QStringLiteral("<<"), QStringLiteral("$&")); str.replace(QLatin1String("<<"), QLatin1String("$&"));
str.replace(QStringLiteral(">>"), QStringLiteral("$$")); str.replace(QLatin1String(">>"), QLatin1String("$$"));
str.replace(QStringLiteral("\\\""), QStringLiteral("$!")); str.replace(QLatin1String("\\\""), QLatin1String("$!"));
str.replace(QStringLiteral("->"), QStringLiteral("$?")); str.replace(QLatin1String("->"), QLatin1String("$?"));
return str; return str;
} }
QString escapeFromBracketMatching(QString str) QString escapeFromBracketMatching(QString str)
{ {
str.replace(QStringLiteral("$&"), QStringLiteral("<<")); str.replace(QLatin1String("$&"), QLatin1String("<<"));
str.replace(QStringLiteral("$$"), QStringLiteral(">>")); str.replace(QLatin1String("$$"), QLatin1String(">>"));
str.replace(QStringLiteral("$!"), QStringLiteral("\\\"")); str.replace(QLatin1String("$!"), QLatin1String("\\\""));
str.replace(QStringLiteral("$?"), QStringLiteral("->")); str.replace(QLatin1String("$?"), QLatin1String("->"));
return str; return str;
} }
......
Markdown is supported
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