From e69551f23e47632d517f7ec7d6efc25580df8df0 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 6 Sep 2012 17:37:20 +0200 Subject: [PATCH] sort tags relying on hash sort order is no good idea Change-Id: I314222bbfd94d29bad1cb7e8b6823b320a88ea75 Reviewed-by: Daniel Teske --- src/linguist/shared/ts.cpp | 10 +++++++--- .../linguist/lupdate/testdata/good/parsecpp/project.ts.result | 2 +- .../linguist/lupdate/testdata/good/parsejs/project.ts.result | 2 +- .../linguist/lupdate/testdata/good/parseqml/project.ts.result | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/linguist/shared/ts.cpp b/src/linguist/shared/ts.cpp index f98a56c..91b6c54 100644 --- a/src/linguist/shared/ts.cpp +++ b/src/linguist/shared/ts.cpp @@ -534,13 +534,17 @@ static QString evilBytes(const QString& str, static void writeExtras(QTextStream &t, const char *indent, const TranslatorMessage::ExtraData &extras, QRegExp drops) { + QStringList outs; for (Translator::ExtraData::ConstIterator it = extras.begin(); it != extras.end(); ++it) { if (!drops.exactMatch(it.key())) { - t << indent << "' - << protect(it.value()) - << "\n"; + outs << (QStringLiteral("') + + protect(it.value()) + + QStringLiteral("')); } } + outs.sort(); + foreach (const QString &out, outs) + t << indent << out << endl; } static void writeVariants(QTextStream &t, const char *indent, const QString &input) diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result index f73fc64..7d87d17 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result @@ -315,8 +315,8 @@ backslashed \ stuff. something cool random comment - totally foo-barred nonsense fooish_bar + totally foo-barred nonsense diff --git a/tests/auto/linguist/lupdate/testdata/good/parsejs/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsejs/project.ts.result index d03c713..5dcc30c 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsejs/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/parsejs/project.ts.result @@ -102,9 +102,9 @@ This string has even more information This is another comment for the translator. + Important stuff Found True - Important stuff diff --git a/tests/auto/linguist/lupdate/testdata/good/parseqml/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parseqml/project.ts.result index 4843902..475305d 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parseqml/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/parseqml/project.ts.result @@ -107,9 +107,9 @@ This string has even more information This is another comment for the translator. + Important stuff Found True - Important stuff -- 2.7.4