diff options
author | Sona Kurazyan <[email protected]> | 2022-04-13 16:28:09 +0200 |
---|---|---|
committer | Sona Kurazyan <[email protected]> | 2022-04-14 15:29:06 +0200 |
commit | d0a08d1f1176f00a8f3dde8dba49f139ab1e2535 (patch) | |
tree | 3761ba328ab3d4d189bb9be5168876ff34214b4b /src/tools/androidtestrunner/main.cpp | |
parent | 252e3a1526dc01c5e5024a4ff4f4fb2e87fbc3d2 (diff) |
Android: stop using QLatin1Char constructor for creating char literals
Required for porting away from QLatin1Char/QLatin1String in scope of
QTBUG-98434.
As a drive-by, fix qsizetype -> int narrowing conversion warnings for
the touched lines.
Change-Id: Iebcbdbd7cecac09d0a7039e3ef6a4509d33039ba
Reviewed-by: Assam Boudjelthia <[email protected]>
Diffstat (limited to 'src/tools/androidtestrunner/main.cpp')
-rw-r--r-- | src/tools/androidtestrunner/main.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/tools/androidtestrunner/main.cpp b/src/tools/androidtestrunner/main.cpp index dbad68ffa37..2f13f911e2a 100644 --- a/src/tools/androidtestrunner/main.cpp +++ b/src/tools/androidtestrunner/main.cpp @@ -211,9 +211,9 @@ static QString shellQuoteUnix(const QString &arg) QString ret(arg); if (hasSpecialChars(ret, iqm)) { - ret.replace(QLatin1Char('\''), QStringLiteral("'\\''")); - ret.prepend(QLatin1Char('\'')); - ret.append(QLatin1Char('\'')); + ret.replace(u'\'', QStringLiteral("'\\''")); + ret.prepend(u'\''); + ret.append(u'\''); } return ret; } @@ -241,18 +241,18 @@ static QString shellQuoteWin(const QString &arg) // The argument must not end with a \ since this would be interpreted // as escaping the quote -- rather put the \ behind the quote: e.g. // rather use "foo"\ than "foo\" - int i = ret.length(); - while (i > 0 && ret.at(i - 1) == QLatin1Char('\\')) + qsizetype i = ret.length(); + while (i > 0 && ret.at(i - 1) == u'\\') --i; - ret.insert(i, QLatin1Char('"')); - ret.prepend(QLatin1Char('"')); + ret.insert(i, u'"'); + ret.prepend(u'"'); } return ret; } static QString shellQuote(const QString &arg) { - if (QDir::separator() == QLatin1Char('\\')) + if (QDir::separator() == u'\\') return shellQuoteWin(arg); else return shellQuoteUnix(arg); |