diff options
-rw-r--r-- | src/linguist/lupdate/cpp.cpp | 9 | ||||
-rw-r--r-- | src/linguist/shared/translator.cpp | 9 | ||||
-rw-r--r-- | src/linguist/shared/translatormessage.cpp | 6 |
3 files changed, 16 insertions, 8 deletions
diff --git a/src/linguist/lupdate/cpp.cpp b/src/linguist/lupdate/cpp.cpp index cd02de34f..3836bfcfd 100644 --- a/src/linguist/lupdate/cpp.cpp +++ b/src/linguist/lupdate/cpp.cpp @@ -2325,11 +2325,14 @@ void loadCPP(Translator &translator, const QStringList &filenames, ConversionDat parser.recordResults(isHeader(filename)); } - foreach (const QString &filename, filenames) - if (!CppFiles::isBlacklisted(filename)) - if (const Translator *tor = CppFiles::getTranslator(filename)) + foreach (const QString &filename, filenames) { + if (!CppFiles::isBlacklisted(filename)) { + if (const Translator *tor = CppFiles::getTranslator(filename)) { foreach (const TranslatorMessage &msg, tor->messages()) translator.extend(msg, cd); + } + } + } } QT_END_NAMESPACE diff --git a/src/linguist/shared/translator.cpp b/src/linguist/shared/translator.cpp index 5b0538d4e..af669e235 100644 --- a/src/linguist/shared/translator.cpp +++ b/src/linguist/shared/translator.cpp @@ -384,11 +384,14 @@ int Translator::find(const QString &context, { if (!refs.isEmpty()) { for (TMM::ConstIterator it = m_messages.constBegin(); it != m_messages.constEnd(); ++it) { - if (it->context() == context && it->comment() == comment) - foreach (const TranslatorMessage::Reference &itref, it->allReferences()) - foreach (const TranslatorMessage::Reference &ref, refs) + if (it->context() == context && it->comment() == comment) { + foreach (const TranslatorMessage::Reference &itref, it->allReferences()) { + foreach (const TranslatorMessage::Reference &ref, refs) { if (itref == ref) return it - m_messages.constBegin(); + } + } + } } } return -1; diff --git a/src/linguist/shared/translatormessage.cpp b/src/linguist/shared/translatormessage.cpp index f9048de70..0cc17f1de 100644 --- a/src/linguist/shared/translatormessage.cpp +++ b/src/linguist/shared/translatormessage.cpp @@ -73,10 +73,12 @@ void TranslatorMessage::addReferenceUniq(const QString &fileName, int lineNumber } else { if (fileName == m_fileName && lineNumber == m_lineNumber) return; - if (!m_extraRefs.isEmpty()) // Rather common case, so special-case it - foreach (const Reference &ref, m_extraRefs) + if (!m_extraRefs.isEmpty()) { // Rather common case, so special-case it + foreach (const Reference &ref, m_extraRefs) { if (fileName == ref.fileName() && lineNumber == ref.lineNumber()) return; + } + } m_extraRefs.append(Reference(fileName, lineNumber)); } } |