summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-04-04 18:08:01 +0200
committerLiang Qi <liang.qi@qt.io>2017-04-04 18:09:33 +0200
commit9419dfe8ee45d08f09c09d3cbece511d721546f0 (patch)
tree1c4584099fc1efb8de30cc4526ce7ebafe8a8ce9 /src/corelib/tools
parent8b5aa7b6c40d70a7ec15b3ea485f28a142fb247c (diff)
parent8675e1c5ee7d1209784a2320f1ae3f486b1eaae4 (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h src/plugins/platforms/xcb/qxcbwindow.cpp Change-Id: Ic747c3c50e68c005b425e7a1ec2a90965527c8bd
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qlocale.cpp6
-rw-r--r--src/corelib/tools/qlocale_win.cpp13
-rw-r--r--src/corelib/tools/qregularexpression.cpp2
-rw-r--r--src/corelib/tools/qstringbuilder.h22
-rw-r--r--src/corelib/tools/qtimezoneprivate_icu.cpp2
-rw-r--r--src/corelib/tools/qtimezoneprivate_win.cpp2
6 files changed, 15 insertions, 32 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 0448a78160..9be20e6676 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -3052,7 +3052,7 @@ QString QLocaleData::doubleToString(const QChar _zero, const QChar plus, const Q
num_str.prepend(QLatin1Char(' '));
if (flags & QLocaleData::CapitalEorX)
- num_str = num_str.toUpper();
+ num_str = std::move(num_str).toUpper();
return num_str;
}
@@ -3134,7 +3134,7 @@ QString QLocaleData::longLongToString(const QChar zero, const QChar group,
}
if (flags & CapitalEorX)
- num_str = num_str.toUpper();
+ num_str = std::move(num_str).toUpper();
if (base == 16 && (flags & ShowBase))
num_str.prepend(QLatin1String(flags & UppercaseBase ? "0X" : "0x"));
@@ -3213,7 +3213,7 @@ QString QLocaleData::unsLongLongToString(const QChar zero, const QChar group,
}
if (flags & CapitalEorX)
- num_str = num_str.toUpper();
+ num_str = std::move(num_str).toUpper();
if (base == 16 && flags & ShowBase)
num_str.prepend(QLatin1String(flags & UppercaseBase ? "0X" : "0x"));
diff --git a/src/corelib/tools/qlocale_win.cpp b/src/corelib/tools/qlocale_win.cpp
index d1abb8b565..2475859abd 100644
--- a/src/corelib/tools/qlocale_win.cpp
+++ b/src/corelib/tools/qlocale_win.cpp
@@ -1037,7 +1037,7 @@ static QString winIso639LangName(LPWSTR id)
if (!lang_code.isEmpty()) {
const char *endptr;
bool ok;
- QByteArray latin1_lang_code = lang_code.toLatin1();
+ QByteArray latin1_lang_code = std::move(lang_code).toLatin1();
int i = qstrtoull(latin1_lang_code, &endptr, 16, &ok);
if (ok && *endptr == '\0') {
switch (i) {
@@ -1120,15 +1120,12 @@ static QByteArray getWinLocaleName(LPWSTR id)
id = lcName;
}
#endif // Q_OS_WINRT
- QString resultuage = winIso639LangName(id);
+ QString resultusage = winIso639LangName(id);
QString country = winIso3116CtryName(id);
- result = resultuage.toLatin1();
- if (!country.isEmpty()) {
- result += '_';
- result += country.toLatin1();
- }
+ if (!country.isEmpty())
+ resultusage += QLatin1Char('_') + country;
- return result;
+ return std::move(resultusage).toLatin1();
}
Q_CORE_EXPORT QLocale qt_localeFromLCID(LCID id)
diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp
index 8366e01ee8..f1fac093b0 100644
--- a/src/corelib/tools/qregularexpression.cpp
+++ b/src/corelib/tools/qregularexpression.cpp
@@ -1674,7 +1674,7 @@ QString QRegularExpression::errorString() const
} while (errorStringLength < 0);
errorString.resize(errorStringLength);
- return QCoreApplication::translate("QRegularExpression", errorString.toLatin1().constData());
+ return QCoreApplication::translate("QRegularExpression", std::move(errorString).toLatin1().constData());
}
return QCoreApplication::translate("QRegularExpression", "no error");
}
diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h
index b2832b5fbe..9a40abcfed 100644
--- a/src/corelib/tools/qstringbuilder.h
+++ b/src/corelib/tools/qstringbuilder.h
@@ -277,9 +277,9 @@ template <> struct QConcatenable<QStringRef> : private QAbstractConcatenable
}
};
-template <int N> struct QConcatenable<char[N]> : private QAbstractConcatenable
+template <int N> struct QConcatenable<const char[N]> : private QAbstractConcatenable
{
- typedef char type[N];
+ typedef const char type[N];
typedef QByteArray ConvertTo;
enum { ExactSize = false };
static int size(const char[N]) { return N - 1; }
@@ -296,23 +296,9 @@ template <int N> struct QConcatenable<char[N]> : private QAbstractConcatenable
}
};
-template <int N> struct QConcatenable<const char[N]> : private QAbstractConcatenable
+template <int N> struct QConcatenable<char[N]> : QConcatenable<const char[N]>
{
- typedef const char type[N];
- typedef QByteArray ConvertTo;
- enum { ExactSize = false };
- static int size(const char[N]) { return N - 1; }
-#ifndef QT_NO_CAST_FROM_ASCII
- static inline void QT_ASCII_CAST_WARN appendTo(const char a[N], QChar *&out)
- {
- QAbstractConcatenable::convertFromAscii(a, N - 1, out);
- }
-#endif
- static inline void appendTo(const char a[N], char *&out)
- {
- while (*a)
- *out++ = *a++;
- }
+ typedef char type[N];
};
template <> struct QConcatenable<const char *> : private QAbstractConcatenable
diff --git a/src/corelib/tools/qtimezoneprivate_icu.cpp b/src/corelib/tools/qtimezoneprivate_icu.cpp
index a07b2593b9..5570ce7571 100644
--- a/src/corelib/tools/qtimezoneprivate_icu.cpp
+++ b/src/corelib/tools/qtimezoneprivate_icu.cpp
@@ -98,7 +98,7 @@ static QByteArray ucalDefaultTimeZoneId()
// If successful on first or second go, resize and return
if (U_SUCCESS(status)) {
result.resize(size);
- return result.toUtf8();
+ return std::move(result).toUtf8();
}
return QByteArray();
diff --git a/src/corelib/tools/qtimezoneprivate_win.cpp b/src/corelib/tools/qtimezoneprivate_win.cpp
index c6d59be3d8..a50227d3cc 100644
--- a/src/corelib/tools/qtimezoneprivate_win.cpp
+++ b/src/corelib/tools/qtimezoneprivate_win.cpp
@@ -299,7 +299,7 @@ static QByteArray windowsSystemZoneId()
id = readRegistryString(key, L"TimeZoneKeyName");
RegCloseKey(key);
if (!id.isEmpty())
- return id.toUtf8();
+ return std::move(id).toUtf8();
}
// On XP we have to iterate over the zones until we find a match on