From ee9bfe83d91f6e5296e262dfe8606b2743a58a43 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 6 Nov 2009 14:23:19 +0100 Subject: improve ordered message insertion in a ts file, the top level categorization are the contexts, so it makes no sense to make messages adjoint by file when the context is different. a more clever algorithm which tries to order the entire contexts is conceivable. that would be advantageous for files which use multiple contexts subsequentially if each context appears in only one file. --- tools/linguist/shared/translator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/linguist/shared/translator.cpp b/tools/linguist/shared/translator.cpp index a35666d..8ff6719 100644 --- a/tools/linguist/shared/translator.cpp +++ b/tools/linguist/shared/translator.cpp @@ -136,7 +136,7 @@ void Translator::appendSorted(const TranslatorMessage &msg) int prevLine = 0; int curIdx = 0; foreach (const TranslatorMessage &mit, m_messages) { - bool sameFile = mit.fileName() == msg.fileName(); + bool sameFile = mit.fileName() == msg.fileName() && mit.context() == msg.context(); int curLine; if (sameFile && (curLine = mit.lineNumber()) >= prevLine) { if (msgLine >= prevLine && msgLine < curLine) { -- cgit v0.12