summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-06 20:07:15 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-06 21:58:00 (GMT)
commit92e9a481518d1c13df32bc2f1a9c8a0ba0b8961a (patch)
tree6e33c6b689330ffe8a2d64443643318882b12d52
parent60acaf5ec7edcd1baf4dd8f80cf93b3e2cb520e4 (diff)
downloadQt-92e9a481518d1c13df32bc2f1a9c8a0ba0b8961a.zip
Qt-92e9a481518d1c13df32bc2f1a9c8a0ba0b8961a.tar.gz
Qt-92e9a481518d1c13df32bc2f1a9c8a0ba0b8961a.tar.bz2
eliminate Translator::replace()
-rw-r--r--tools/linguist/lupdate/merge.cpp10
-rw-r--r--tools/linguist/shared/translator.cpp9
-rw-r--r--tools/linguist/shared/translator.h1
3 files changed, 3 insertions, 17 deletions
diff --git a/tools/linguist/lupdate/merge.cpp b/tools/linguist/lupdate/merge.cpp
index 1ae4cfb..6b8d4bb 100644
--- a/tools/linguist/lupdate/merge.cpp
+++ b/tools/linguist/lupdate/merge.cpp
@@ -247,10 +247,8 @@ int applyNumberHeuristic(Translator &tor)
t = translated.find(zeroKey((*u).sourceText()));
if (t != translated.end() && !t.key().isEmpty()
&& t->sourceText() != u->sourceText()) {
- TranslatorMessage m = *u;
- m.setTranslation(translationAttempt(t->translation(), t->sourceText(),
- u->sourceText()));
- tor.replace(m);
+ u->setTranslation(translationAttempt(t->translation(), t->sourceText(),
+ u->sourceText()));
inserted++;
}
}
@@ -305,9 +303,7 @@ int applySameTextHeuristic(Translator &tor)
QString key = u->sourceText();
t = translated.find(key);
if (t != translated.end()) {
- TranslatorMessage m = *u;
- m.setTranslations(t->translations());
- tor.replace(m);
+ u->setTranslations(t->translations());
++inserted;
}
}
diff --git a/tools/linguist/shared/translator.cpp b/tools/linguist/shared/translator.cpp
index 3b7ee9a..92ecf07 100644
--- a/tools/linguist/shared/translator.cpp
+++ b/tools/linguist/shared/translator.cpp
@@ -80,15 +80,6 @@ QList<Translator::FileFormat> &Translator::registeredFileFormats()
return theFormats;
}
-void Translator::replace(const TranslatorMessage &msg)
-{
- int index = m_messages.indexOf(msg);
- if (index == -1)
- m_messages.append(msg);
- else
- m_messages[index] = msg;
-}
-
void Translator::replaceSorted(const TranslatorMessage &msg)
{
int index = m_messages.indexOf(msg);
diff --git a/tools/linguist/shared/translator.h b/tools/linguist/shared/translator.h
index 6db6f3a..c51993d 100644
--- a/tools/linguist/shared/translator.h
+++ b/tools/linguist/shared/translator.h
@@ -122,7 +122,6 @@ public:
bool contains(const QString &context) const;
TranslatorMessage find(const QString &context) const;
- void replace(const TranslatorMessage &msg);
void replaceSorted(const TranslatorMessage &msg);
void extend(const TranslatorMessage &msg); // Only for single-location messages
void append(const TranslatorMessage &msg);