aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-11-29 14:43:39 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-12-02 21:00:18 +0100
commitc23dcca0a0d768f87c1fa164380f1028ce1ee43d (patch)
tree57acbba62b2fe366a30abf110910a139f08162b4 /src
parent98fea3ae261313b88cb3f67c7f9d3368e635cd51 (diff)
Use UTF-16 literals where possible
This should minimize diffs to Qt 6. Change-Id: I4ba077ebec3b1d76f822b74328ab55235d1ee11a Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/imports/winextras/qquickiconloader_p.h4
-rw-r--r--src/winextras/qwinjumplist.cpp14
2 files changed, 9 insertions, 9 deletions
diff --git a/src/imports/winextras/qquickiconloader_p.h b/src/imports/winextras/qquickiconloader_p.h
index bc23581..22aaae6 100644
--- a/src/imports/winextras/qquickiconloader_p.h
+++ b/src/imports/winextras/qquickiconloader_p.h
@@ -118,7 +118,7 @@ QQuickIconLoader::LoadResult
Object *receiver, void (Object::*function)(const QVariant &))
{
const QString scheme = url.scheme();
- if (scheme.startsWith(QLatin1String("http"))) {
+ if (scheme.startsWith(u"http")) {
if (QNetworkReply *reply = QQuickIconLoader::loadFromNetwork(url, engine)) {
auto *handler = new QQuickIconLoaderNetworkReplyHandler(reply, type);
QObject::connect(handler, &QQuickIconLoaderNetworkReplyHandler::finished, receiver, function);
@@ -126,7 +126,7 @@ QQuickIconLoader::LoadResult
}
return LoadError;
}
- const QVariant resource = scheme == QLatin1String("image")
+ const QVariant resource = scheme == u"image"
? QQuickIconLoader::loadFromImageProvider(url, engine, type, requestedSize)
: QQuickIconLoader::loadFromFile(url, type); // qrc, file
if (resource.isValid()) {
diff --git a/src/winextras/qwinjumplist.cpp b/src/winextras/qwinjumplist.cpp
index 55c99f4..f479096 100644
--- a/src/winextras/qwinjumplist.cpp
+++ b/src/winextras/qwinjumplist.cpp
@@ -97,17 +97,17 @@ static QString createArguments(const QStringList &arguments)
QString tmp = arguments.at(i);
// Quotes are escaped and their preceding backslashes are doubled.
tmp.replace(QRegularExpression(QLatin1String("(\\\\*)\"")), QLatin1String("\\1\\1\\\""));
- if (tmp.isEmpty() || tmp.contains(QLatin1Char(' ')) || tmp.contains(QLatin1Char('\t'))) {
+ if (tmp.isEmpty() || tmp.contains(u' ') || tmp.contains(u'\t')) {
// 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 = tmp.length();
- while (i > 0 && tmp.at(i - 1) == QLatin1Char('\\'))
+ while (i > 0 && tmp.at(i - 1) == u'\\')
--i;
- tmp.insert(i, QLatin1Char('"'));
- tmp.prepend(QLatin1Char('"'));
+ tmp.insert(i, u'"');
+ tmp.prepend(u'"');
}
- args += QLatin1Char(' ') + tmp;
+ args += u' ' + tmp;
}
return args;
}
@@ -120,7 +120,7 @@ void QWinJumpListPrivate::warning(const char *function, HRESULT hresult)
QString QWinJumpListPrivate::iconsDirPath()
{
- QString iconDirPath = QDir::tempPath() + QLatin1Char('/')
+ QString iconDirPath = QDir::tempPath() + u'/'
+ QCoreApplication::applicationName() + QLatin1String("/qt-jl-icons/");
QDir().mkpath(iconDirPath);
return iconDirPath;
@@ -480,7 +480,7 @@ void QWinJumpList::setIdentifier(const QString &identifier)
{
Q_D(QWinJumpList);
QString id = identifier;
- id.replace(QLatin1Char(' '), QLatin1Char('_'));
+ id.replace(u' ', u'_');
if (id.size() > 128)
id.truncate(128);
if (d->identifier != id) {