summaryrefslogtreecommitdiffstats
path: root/tests/auto/linguist/lupdate/testdata/good
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-04-27 20:36:32 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-04-30 09:22:40 +0000
commit2d7a87870c5646e9a11f994e0f5e3dbe49228ece (patch)
tree8629c9a9256504c076f780dd9c2f4be30fd9ad53 /tests/auto/linguist/lupdate/testdata/good
parent6865ece17cc4db9e236446b447a206a723a8d71b (diff)
update message index when message gains source text
when a message which is first seen with only an id later gains a source text, this text would not have been indexed. so a subsequent new message with the same source, but without an id this time around, would not be seen as a dupe of the first message. Change-Id: Ib35f820e2b02311ea9c9996383a2789095098d6f Reviewed-by: hjk <hjk@theqtcompany.com>
Diffstat (limited to 'tests/auto/linguist/lupdate/testdata/good')
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp16
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result7
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp
index 074ed6611..4fdd489b6 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp
@@ -394,3 +394,19 @@ Class42::hello(int something /*= 17 */, QString str = Class42::tr("eyo"))
// test TR_EXCLUDE
#include "notincluded.cpp"
+
+
+
+// failure to update index on insertion messes up subsequent de-duplication
+int dupeFail()
+{
+ // First just the Id.
+ qtTrId("dupe_id");
+
+ // Then with source
+ //% "This is the source"
+ qtTrId("dupe_id");
+
+ // Finally, same source, but without ID.
+ QCoreApplication::translate("", "This is the source");
+}
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result
index c0a4a83b2..0c0c1b511 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result
@@ -24,6 +24,13 @@ backslashed \ stuff.</source>
<extracomment>This is a message without a source string</extracomment>
<translation type="unfinished"></translation>
</message>
+ <message id="dupe_id">
+ <location filename="main.cpp" line="404"/>
+ <location filename="main.cpp" line="408"/>
+ <location filename="main.cpp" line="411"/>
+ <source>This is the source</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>Bogus</name>