summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-06-01 17:43:49 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-06-01 19:34:45 (GMT)
commit8a5d0e6c3d1cf6b269f755a8d54b25b704ba8356 (patch)
tree556ec46d8b10d4016f1ddd6cfc8df803cdc4381a /tools
parentdc587b47af5fec8268ccd33935f6abe442ae8904 (diff)
downloadQt-8a5d0e6c3d1cf6b269f755a8d54b25b704ba8356.zip
Qt-8a5d0e6c3d1cf6b269f755a8d54b25b704ba8356.tar.gz
Qt-8a5d0e6c3d1cf6b269f755a8d54b25b704ba8356.tar.bz2
remove Translator::translatedMessages()
it's inefficient to construct a new list. on top of that, the only user actually checks the message state again.
Diffstat (limited to 'tools')
-rw-r--r--tools/linguist/shared/simtexth.cpp4
-rw-r--r--tools/linguist/shared/translator.cpp9
-rw-r--r--tools/linguist/shared/translator.h1
3 files changed, 1 insertions, 13 deletions
diff --git a/tools/linguist/shared/simtexth.cpp b/tools/linguist/shared/simtexth.cpp
index 31253d6..8933507 100644
--- a/tools/linguist/shared/simtexth.cpp
+++ b/tools/linguist/shared/simtexth.cpp
@@ -238,9 +238,7 @@ CandidateList similarTextHeuristicCandidates(const Translator *tor,
QList<int> scores;
CandidateList candidates;
- TML all = tor->translatedMessages();
-
- foreach (const TranslatorMessage &mtm, all) {
+ foreach (const TranslatorMessage &mtm, tor->messages()) {
if (mtm.type() == TranslatorMessage::Unfinished
|| mtm.translation().isEmpty())
continue;
diff --git a/tools/linguist/shared/translator.cpp b/tools/linguist/shared/translator.cpp
index 0c2678d..0cf24f5 100644
--- a/tools/linguist/shared/translator.cpp
+++ b/tools/linguist/shared/translator.cpp
@@ -613,15 +613,6 @@ QList<TranslatorMessage> Translator::messages() const
return m_messages;
}
-QList<TranslatorMessage> Translator::translatedMessages() const
-{
- TMM result;
- for (TMM::ConstIterator it = m_messages.begin(); it != m_messages.end(); ++it)
- if (it->type() == TranslatorMessage::Finished)
- result.append(*it);
- return result;
-}
-
QStringList Translator::normalizedTranslations(const TranslatorMessage &msg, int numPlurals)
{
QStringList translations = msg.translations();
diff --git a/tools/linguist/shared/translator.h b/tools/linguist/shared/translator.h
index bb147b8..9685e21 100644
--- a/tools/linguist/shared/translator.h
+++ b/tools/linguist/shared/translator.h
@@ -169,7 +169,6 @@ public:
void setSourceLanguageCode(const QString &languageCode) { m_sourceLanguage = languageCode; }
static QString guessLanguageCodeFromFileName(const QString &fileName);
QList<TranslatorMessage> messages() const;
- QList<TranslatorMessage> translatedMessages() const;
static QStringList normalizedTranslations(const TranslatorMessage &m, int numPlurals);
void normalizeTranslations(ConversionData &cd);
QStringList normalizedTranslations(const TranslatorMessage &m, ConversionData &cd, bool *ok) const;