summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-04-12 12:33:20 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-04-12 12:33:20 (GMT)
commitc72928c26118a3aa6491dba523da0594de8b48ba (patch)
tree6f9c6ca5ebfde0711319e734d550c615ea8ca5c5 /tools
parentb6f1dd4151c5bbcb7d4367ec972c9026ab9e68be (diff)
parente22e36bc61b4af7c0a9113617df5a35ed315dede (diff)
downloadQt-c72928c26118a3aa6491dba523da0594de8b48ba.zip
Qt-c72928c26118a3aa6491dba523da0594de8b48ba.tar.gz
Qt-c72928c26118a3aa6491dba523da0594de8b48ba.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: look for makespec in the build dir first make collection of SUBDIRS in solution generator less bizarre run depend_command in build dir in VS generators as well fixify target source against build tree fix fixifying of QMAKE_SUBSTITUTES dist target: fixify OBJECTS_DIR against output dir fix paths of vpath-resolved files simplify: absolute fixification ignores the base dir arguments simplify: fileFixify for all same paths is always "." simplify: the input and output dirs are already normalized stop fixifying after first success create a pwd string with a trailing slash only on demand make uic3-generated moc files depend on mocinclude.tmp useful location reporting for errors from QMAKE_SUBSTITUTES clean up visual studio identification code prefix TEMPLATE_PREFIX to TEMPLATE even if it is "default-constructed" fix detection of relative location information
Diffstat (limited to 'tools')
-rw-r--r--tools/linguist/shared/ts.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/linguist/shared/ts.cpp b/tools/linguist/shared/ts.cpp
index 85be5c6..4523bc5 100644
--- a/tools/linguist/shared/ts.cpp
+++ b/tools/linguist/shared/ts.cpp
@@ -264,6 +264,7 @@ bool TSReader::read(Translator &translator)
//qDebug() << "TS " << attributes();
QHash<QString, int> currentLine;
QString currentFile;
+ bool maybeRelative = false, maybeAbsolute = false;
QXmlStreamAttributes atts = attributes();
//QString version = atts.value(strversion).toString();
@@ -342,10 +343,12 @@ bool TSReader::read(Translator &translator)
msg.setTranslatorComment(readContents());
} else if (elementStarts(strlocation)) {
// <location/>
+ maybeAbsolute = true;
QXmlStreamAttributes atts = attributes();
QString fileName = atts.value(strfilename).toString();
if (fileName.isEmpty()) {
fileName = currentMsgFile;
+ maybeRelative = true;
} else {
if (refs.isEmpty())
currentFile = fileName;
@@ -353,7 +356,6 @@ bool TSReader::read(Translator &translator)
}
const QString lin = atts.value(strline).toString();
if (lin.isEmpty()) {
- translator.setLocationsType(Translator::RelativeLocations);
refs.append(TranslatorMessage::Reference(fileName, -1));
} else {
bool bOK;
@@ -361,9 +363,7 @@ bool TSReader::read(Translator &translator)
if (bOK) {
if (lin.startsWith(QLatin1Char('+')) || lin.startsWith(QLatin1Char('-'))) {
lineNo = (currentLine[fileName] += lineNo);
- translator.setLocationsType(Translator::RelativeLocations);
- } else {
- translator.setLocationsType(Translator::AbsoluteLocations);
+ maybeRelative = true;
}
refs.append(TranslatorMessage::Reference(fileName, lineNo));
}
@@ -422,6 +422,9 @@ bool TSReader::read(Translator &translator)
} else {
handleError();
}
+ translator.setLocationsType(maybeRelative ? Translator::RelativeLocations :
+ maybeAbsolute ? Translator::AbsoluteLocations :
+ Translator::NoLocations);
} // </TS>
} else {
handleError();
@@ -727,7 +730,6 @@ bool saveTS(const Translator &translator, QIODevice &dev, ConversionData &cd, in
bool loadTS(Translator &translator, QIODevice &dev, ConversionData &cd)
{
- translator.setLocationsType(Translator::NoLocations);
TSReader reader(dev, cd);
return reader.read(translator);
}