diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-04-13 14:30:28 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-05-02 23:38:45 +0000 |
commit | a0539ed53f45619df7e4aad664369301dd6da091 (patch) | |
tree | 3529ce5147346c7686bc9c901894b88b06a5dcc2 /src/tools/rcc/main.cpp | |
parent | 8d6eae7ffd1da8322dff7ca87c092232d9a5f7b4 (diff) |
Tools: 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: Ib9e01ede4e0d7869fc95414d36f37df4a30b16b4
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/tools/rcc/main.cpp')
-rw-r--r-- | src/tools/rcc/main.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/tools/rcc/main.cpp b/src/tools/rcc/main.cpp index d9d211c19d..14da7099e5 100644 --- a/src/tools/rcc/main.cpp +++ b/src/tools/rcc/main.cpp @@ -105,11 +105,11 @@ QString makefileEscape(const QString &filepath) // Always use forward slashes QString result = QDir::cleanPath(filepath); // Spaces are escaped with a backslash - result.replace(QLatin1Char(' '), QLatin1String("\\ ")); + result.replace(u' ', QLatin1String("\\ ")); // Pipes are escaped with a backslash - result.replace(QLatin1Char('|'), QLatin1String("\\|")); + result.replace(u'|', QLatin1String("\\|")); // Dollars are escaped with a dollar - result.replace(QLatin1Char('$'), QLatin1String("$$")); + result.replace(u'$', QLatin1String("$$")); return result; } @@ -118,16 +118,16 @@ void writeDepFile(QIODevice &iodev, const QStringList &depsList, const QString & { QTextStream out(&iodev); out << qPrintable(makefileEscape(targetName)); - out << QLatin1Char(':'); + out << QChar(u':'); // Write depfile for (int i = 0; i < depsList.size(); ++i) { - out << QLatin1Char(' '); + out << QChar(u' '); out << qPrintable(makefileEscape(depsList.at(i))); } - out << QLatin1Char('\n'); + out << QChar(u'\n'); } int runRcc(int argc, char *argv[]) @@ -244,8 +244,7 @@ int runRcc(int argc, char *argv[]) library.setInitName(parser.value(nameOption)); if (parser.isSet(rootOption)) { library.setResourceRoot(QDir::cleanPath(parser.value(rootOption))); - if (library.resourceRoot().isEmpty() - || library.resourceRoot().at(0) != QLatin1Char('/')) + if (library.resourceRoot().isEmpty() || library.resourceRoot().at(0) != u'/') errorMsg = QLatin1String("Root must start with a /"); } |