summaryrefslogtreecommitdiffstats
path: root/src/linguist/lupdate/qdeclarative.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2023-02-06 13:01:14 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2023-02-13 12:23:56 +0100
commit4d6f211f640a8278d287879ffb70a62303452ab7 (patch)
treee2d53ac3de290c0cc954daea7e25f3aa121aba39 /src/linguist/lupdate/qdeclarative.cpp
parent00cc7b2e4a39eea81abf46b485a98c2cfc79630c (diff)
lupdate: Disambiguate string constants
Complements 0f092219165ecd5751ef73cb939364134a0319ee. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: I098f2d42bbc367cee89284fb6fb2d2c7cfc5c54d Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/linguist/lupdate/qdeclarative.cpp')
-rw-r--r--src/linguist/lupdate/qdeclarative.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/linguist/lupdate/qdeclarative.cpp b/src/linguist/lupdate/qdeclarative.cpp
index a99f7dff6..1aabc6eca 100644
--- a/src/linguist/lupdate/qdeclarative.cpp
+++ b/src/linguist/lupdate/qdeclarative.cpp
@@ -30,7 +30,9 @@ QT_BEGIN_NAMESPACE
using namespace QQmlJS;
-static QString MagicComment(QLatin1String("TRANSLATOR"));
+using namespace Qt::StringLiterals;
+
+static QString QmlMagicComment = u"TRANSLATOR"_s;
class FindTrCalls: protected AST::Visitor
{
@@ -369,8 +371,8 @@ void FindTrCalls::processComment(const SourceLocation &loc)
ushort c;
while ((c = chars[idx].unicode()) == ' ' || c == '\t' || c == '\r' || c == '\n')
++idx;
- if (!memcmp(chars + idx, MagicComment.unicode(), MagicComment.size() * 2)) {
- idx += MagicComment.size();
+ if (!memcmp(chars + idx, QmlMagicComment.unicode(), QmlMagicComment.size() * 2)) {
+ idx += QmlMagicComment.size();
QString comment = QString(chars + idx, length - idx).simplified();
int k = comment.indexOf(QLatin1Char(' '));
if (k == -1) {