summaryrefslogtreecommitdiff
path: root/qmake
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2011-08-03 15:01:05 +0300
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2011-08-03 15:35:43 +0300
commitc8af8eaaf6e3a991d488cec56f7c901d88dfc098 (patch)
tree151615f1e1f4250f3528ee73c6d3fb85ae933176 /qmake
parent983dca7f3d92bd4f284f83464c164d5fa580b48f (diff)
downloadqt4-tools-c8af8eaaf6e3a991d488cec56f7c901d88dfc098.tar.gz
Ignore child elements in non-application caption/pkg name translations
In Symbian, when parsing .ts files for deployment localization, qmake would break if there was any translation using lengthvariants inside QtApplicationCaptions context. Technically this is legal though QtApplicationCaptions context is only meant for application captions and we don't support lenghtvariants for the actual captions themselves. Changed parsing so that any child elements on translations are simply skipped instead of causing parsing errors. Task-number: QT-5169 Reviewed-by: Guoqing Zhang
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/symbian/symbiancommon.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp
index 8f3bf64589..8daef4b8f8 100644
--- a/qmake/generators/symbian/symbiancommon.cpp
+++ b/qmake/generators/symbian/symbiancommon.cpp
@@ -993,7 +993,12 @@ bool SymbianCommonGenerator::parseTsContent(const QString &tsFilename, SymbianLo
if (xml.name() == sourceElement) {
source = xml.readElementText();
} else if (xml.name() == translationElement) {
- translation = xml.readElementText();
+ // Technically translation element can have child elements
+ // i.e. numerusform and lengthvariant. We don't support
+ // these for actual caption/pkgname translations, but since
+ // they may be present on other unrelated message elements,
+ // we need to explicitly skip them to avoid parsing errors.
+ translation = xml.readElementText(QXmlStreamReader::SkipChildElements);
} else {
xml.skipCurrentElement();
}