summaryrefslogtreecommitdiffstats
path: root/src/linguist/shared/po.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-10-06 11:42:43 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-10-06 18:20:23 +0200
commitd6dfdf3ad3f68a97fd4fc2843a5d5fb424193b4b (patch)
tree2a9f9447f0a904174ead25287b1313fe728257b8 /src/linguist/shared/po.cpp
parentc338447261878111df7198fbd96051926464e865 (diff)
Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I234704ba429750ddee958a82f6c941d041da0653 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/linguist/shared/po.cpp')
-rw-r--r--src/linguist/shared/po.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/linguist/shared/po.cpp b/src/linguist/shared/po.cpp
index ba69e017c..3a0742c53 100644
--- a/src/linguist/shared/po.cpp
+++ b/src/linguist/shared/po.cpp
@@ -548,7 +548,7 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd)
msg.setTranslatorComment(toUnicode(item.translatorComments));
msg.setPlural(item.isPlural || item.msgStr.size() > 1);
QStringList translations;
- for (const QByteArray &bstr : qAsConst(item.msgStr)) {
+ for (const QByteArray &bstr : std::as_const(item.msgStr)) {
QString str = toUnicode(bstr);
str.replace(QChar(Translator::TextVariantSeparator),
QChar(Translator::BinaryVariantSeparator));
@@ -741,7 +741,7 @@ bool savePO(const Translator &translator, QIODevice &dev, ConversionData &)
if (qtContexts)
addPoHeader(headers, hdrOrder, "X-Qt-Contexts", QLatin1String("true"));
QString hdrStr;
- for (const QString &hdr : qAsConst(hdrOrder)) {
+ for (const QString &hdr : std::as_const(hdrOrder)) {
hdrStr += hdr;
hdrStr += QLatin1String(": ");
hdrStr += headers.value(makePoHeader(hdr));