summaryrefslogtreecommitdiffstats
path: root/tools/linguist/lupdate/merge.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-05 14:19:02 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-06 21:58:01 (GMT)
commit0a1db39ba70060f305e5694d1a12dd3c2e5bca4c (patch)
tree0e5786d7497ac56e2ef0ba2a665c7b0d642a4c62 /tools/linguist/lupdate/merge.cpp
parenta66698f947e8ded2e020defa626b154aca1fde9f (diff)
downloadQt-0a1db39ba70060f305e5694d1a12dd3c2e5bca4c.zip
Qt-0a1db39ba70060f305e5694d1a12dd3c2e5bca4c.tar.gz
Qt-0a1db39ba70060f305e5694d1a12dd3c2e5bca4c.tar.bz2
record id-based messages even if they have an empty source
this makes sense if one uses lupdate only for validation purposes, i.e. to find out if the code uses only ids which are defined in some external specification.
Diffstat (limited to 'tools/linguist/lupdate/merge.cpp')
-rw-r--r--tools/linguist/lupdate/merge.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/linguist/lupdate/merge.cpp b/tools/linguist/lupdate/merge.cpp
index a721439..fa0dd3d 100644
--- a/tools/linguist/lupdate/merge.cpp
+++ b/tools/linguist/lupdate/merge.cpp
@@ -341,7 +341,7 @@ Translator merge(const Translator &tor, const Translator &virginTor,
foreach (TranslatorMessage m, tor.messages()) {
TranslatorMessage::Type newType = TranslatorMessage::Finished;
- if (m.sourceText().isEmpty()) {
+ if (m.sourceText().isEmpty() && m.id().isEmpty()) {
// context/file comment
TranslatorMessage mv = virginTor.find(m.context());
if (!mv.isNull())
@@ -447,7 +447,7 @@ Translator merge(const Translator &tor, const Translator &virginTor,
vernacular translator.
*/
foreach (const TranslatorMessage &mv, virginTor.messages()) {
- if (mv.sourceText().isEmpty()) {
+ if (mv.sourceText().isEmpty() && mv.id().isEmpty()) {
if (tor.contains(mv.context()))
continue;
} else {
@@ -465,7 +465,7 @@ Translator merge(const Translator &tor, const Translator &virginTor,
outTor.append(mv);
else
outTor.appendSorted(mv);
- if (!mv.sourceText().isEmpty())
+ if (!mv.sourceText().isEmpty() || !mv.id().isEmpty())
++neww;
}