summaryrefslogtreecommitdiffstats
path: root/tools/linguist
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-05 19:01:22 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-06 21:58:00 (GMT)
commitffa332a3c8eef08695791b9fdccfd2677ec325fc (patch)
treec0522c1ce2c5d43717c5e85242f637e0aa32c07b /tools/linguist
parent79864599ec3a1ce5a5ede84ea2d3d7ba437a3257 (diff)
downloadQt-ffa332a3c8eef08695791b9fdccfd2677ec325fc.zip
Qt-ffa332a3c8eef08695791b9fdccfd2677ec325fc.tar.gz
Qt-ffa332a3c8eef08695791b9fdccfd2677ec325fc.tar.bz2
cut code dupe ...
... with gotos :)
Diffstat (limited to 'tools/linguist')
-rw-r--r--tools/linguist/lupdate/merge.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/tools/linguist/lupdate/merge.cpp b/tools/linguist/lupdate/merge.cpp
index cffbfa3..1ae4cfb 100644
--- a/tools/linguist/lupdate/merge.cpp
+++ b/tools/linguist/lupdate/merge.cpp
@@ -355,6 +355,7 @@ Translator merge(const Translator &tor, const Translator &virginTor,
int mvi = virginTor.messages().indexOf(m);
if (mvi < 0) {
if (!(options & HeuristicSimilarText)) {
+ makeObsolete:
newType = TranslatorMessage::Obsolete;
if (m.type() != TranslatorMessage::Obsolete)
obsoleted++;
@@ -363,10 +364,7 @@ Translator merge(const Translator &tor, const Translator &virginTor,
mv = virginTor.find(m.context(), m.comment(), m.allReferences());
if (mv.isNull()) {
// did not find it in the virgin, mark it as obsolete
- newType = TranslatorMessage::Obsolete;
- if (m.type() != TranslatorMessage::Obsolete)
- obsoleted++;
- m.clearReferences();
+ goto makeObsolete;
} else {
// Do not just accept it if its on the same line number,
// but different source text.
@@ -388,17 +386,11 @@ Translator merge(const Translator &tor, const Translator &virginTor,
m.setExtra(QLatin1String("po-old_msgid_plural"), oldpluralsource);
m.unsetExtra(QLatin1String("po-msgid_plural"));
}
- m.setReferences(mv.allReferences()); // Update secondary references
- m.setPlural(mv.isPlural());
- m.setUtf8(mv.isUtf8());
- m.setExtraComment(mv.extraComment());
+ goto copyAttribs; // Update secondary references
} else {
// The virgin and vernacular sourceTexts are so
// different that we could not find it.
- newType = TranslatorMessage::Obsolete;
- if (m.type() != TranslatorMessage::Obsolete)
- obsoleted++;
- m.clearReferences();
+ goto makeObsolete;
}
}
}
@@ -428,6 +420,7 @@ Translator merge(const Translator &tor, const Translator &virginTor,
// This should also enable us to read a file that does not
// have the <location> element.
// why not use operator=()? Because it overwrites e.g. userData.
+ copyAttribs:
m.setReferences(mv.allReferences());
m.setPlural(mv.isPlural());
m.setUtf8(mv.isUtf8());