summaryrefslogtreecommitdiffstats
path: root/tools/linguist
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-06 13:23:19 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-06 21:58:01 (GMT)
commit1bf836526332626825c21e7e62305d2019c65701 (patch)
tree8041d8d7cc396206cb570ae516283a2187ff3ce2 /tools/linguist
parente9a0d840133f53e2a2fb138b9042000c883d0283 (diff)
downloadQt-1bf836526332626825c21e7e62305d2019c65701.zip
Qt-1bf836526332626825c21e7e62305d2019c65701.tar.gz
Qt-1bf836526332626825c21e7e62305d2019c65701.tar.bz2
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.
Diffstat (limited to 'tools/linguist')
-rw-r--r--tools/linguist/shared/translator.cpp2
1 files changed, 1 insertions, 1 deletions
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) {