summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-06 13:23:19 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2009-11-11 17:21:19 (GMT)
commitee9bfe83d91f6e5296e262dfe8606b2743a58a43 (patch)
tree2e073397dcb2c68fa4436441dd983da6ca631c5e /tools
parenta0021a60bbec8b6ab5c9f8854747857e9e388457 (diff)
downloadQt-ee9bfe83d91f6e5296e262dfe8606b2743a58a43.zip
Qt-ee9bfe83d91f6e5296e262dfe8606b2743a58a43.tar.gz
Qt-ee9bfe83d91f6e5296e262dfe8606b2743a58a43.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')
-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) {