summaryrefslogtreecommitdiffstats
path: root/tools/linguist
diff options
context:
space:
mode:
Diffstat (limited to 'tools/linguist')
-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);