summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qlocale_unix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/text/qlocale_unix.cpp')
-rw-r--r--src/corelib/text/qlocale_unix.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/corelib/text/qlocale_unix.cpp b/src/corelib/text/qlocale_unix.cpp
index c0f44fb953..a934f24c01 100644
--- a/src/corelib/text/qlocale_unix.cpp
+++ b/src/corelib/text/qlocale_unix.cpp
@@ -124,7 +124,7 @@ QLocale QSystemLocale::fallbackLocale() const
return QLocale(lang);
}
-QVariant QSystemLocale::query(QueryType type, QVariant in) const
+QVariant QSystemLocale::query(QueryType type, QVariant &&in) const
{
QSystemLocaleData *d = qSystemLocaleData();
@@ -244,9 +244,9 @@ QVariant QSystemLocale::query(QueryType type, QVariant in) const
else
lst = languages.split(u':');
- for (int i = 0; i < lst.size(); ++i) {
+ for (const QString &e : std::as_const(lst)) {
QStringView language, script, territory;
- if (qt_splitLocaleName(lst.at(i), &language, &script, &territory)) {
+ if (qt_splitLocaleName(e, &language, &script, &territory)) {
QString joined = language.isEmpty() ? u"und"_s : language.toString();
if (!script.isEmpty())
joined += u'-' + script;
@@ -258,13 +258,15 @@ QVariant QSystemLocale::query(QueryType type, QVariant in) const
return d->uiLanguages.isEmpty() ? QVariant() : QVariant(d->uiLanguages);
}
case StringToStandardQuotation:
- return lc_messages.quoteString(qvariant_cast<QStringView>(in));
+ return lc_messages.quoteString(qvariant_cast<QStringView>(std::move(in)));
case StringToAlternateQuotation:
- return lc_messages.quoteString(qvariant_cast<QStringView>(in), QLocale::AlternateQuotation);
+ return lc_messages.quoteString(qvariant_cast<QStringView>(std::move(in)),
+ QLocale::AlternateQuotation);
case ListToSeparatedString:
return lc_messages.createSeparatedList(in.toStringList());
case LocaleChanged:
Q_ASSERT(false);
+ [[fallthrough]];
default:
break;
}