summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-06-01 16:20:58 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-06-01 19:34:44 (GMT)
commitdc587b47af5fec8268ccd33935f6abe442ae8904 (patch)
treee1d81a1055aec2a1e9246fb7b9915e498813312e /tools
parenta107d3e22e128ec343d82f902de4c6ee0e33435f (diff)
downloadQt-dc587b47af5fec8268ccd33935f6abe442ae8904.zip
Qt-dc587b47af5fec8268ccd33935f6abe442ae8904.tar.gz
Qt-dc587b47af5fec8268ccd33935f6abe442ae8904.tar.bz2
remove Translator::contains()
it's redundant with find() now, as the latter is cheap now
Diffstat (limited to 'tools')
-rw-r--r--tools/linguist/lupdate/merge.cpp2
-rw-r--r--tools/linguist/shared/translator.cpp8
-rw-r--r--tools/linguist/shared/translator.h1
3 files changed, 1 insertions, 10 deletions
diff --git a/tools/linguist/lupdate/merge.cpp b/tools/linguist/lupdate/merge.cpp
index 1c992c3..8b6624d 100644
--- a/tools/linguist/lupdate/merge.cpp
+++ b/tools/linguist/lupdate/merge.cpp
@@ -454,7 +454,7 @@ Translator merge(const Translator &tor, const Translator &virginTor,
*/
foreach (const TranslatorMessage &mv, virginTor.messages()) {
if (mv.sourceText().isEmpty() && mv.id().isEmpty()) {
- if (tor.contains(mv.context()))
+ if (tor.find(mv.context()) >= 0)
continue;
} else {
if (tor.find(mv) >= 0)
diff --git a/tools/linguist/shared/translator.cpp b/tools/linguist/shared/translator.cpp
index 91a5a26..0c2678d 100644
--- a/tools/linguist/shared/translator.cpp
+++ b/tools/linguist/shared/translator.cpp
@@ -361,14 +361,6 @@ int Translator::find(const QString &context,
return -1;
}
-bool Translator::contains(const QString &context) const
-{
- foreach (const TranslatorMessage &msg, m_messages)
- if (msg.context() == context && msg.sourceText().isEmpty() && msg.id().isEmpty())
- return true;
- return false;
-}
-
int Translator::find(const QString &context) const
{
for (TMM::ConstIterator it = m_messages.constBegin(); it != m_messages.constEnd(); ++it)
diff --git a/tools/linguist/shared/translator.h b/tools/linguist/shared/translator.h
index 41f0396..bb147b8 100644
--- a/tools/linguist/shared/translator.h
+++ b/tools/linguist/shared/translator.h
@@ -130,7 +130,6 @@ public:
int find(const QString &context,
const QString &comment, const TranslatorMessage::References &refs) const;
- bool contains(const QString &context) const;
int find(const QString &context) const;
void replaceSorted(const TranslatorMessage &msg);