Changeset 651 for trunk/tools/linguist/lrelease/main.cpp
- Timestamp:
- Mar 8, 2010, 12:52:58 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.2 (added) merged: 650 /branches/vendor/nokia/qt/current merged: 649 /branches/vendor/nokia/qt/4.6.1 removed
- Property svn:mergeinfo changed
-
trunk/tools/linguist/lrelease/main.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 41 41 42 42 #include "translator.h" 43 #include "pro reader.h"43 #include "profileevaluator.h" 44 44 45 45 #ifndef QT_BOOTSTRAPPED … … 112 112 printOut(cd.error()); 113 113 } 114 cd.clearErrors(); 114 115 return ok; 115 116 } … … 142 143 qWarning("lrelease error: cannot save '%s': %s\n", 143 144 qPrintable(qmFileName), qPrintable(cd.error())); 144 return false;145 145 } else if (!cd.errors().isEmpty()) { 146 146 printOut(cd.error()); 147 147 } 148 return true; 148 cd.clearErrors(); 149 return ok; 149 150 } 150 151 … … 246 247 if (inputFile.endsWith(QLatin1String(".pro"), Qt::CaseInsensitive) 247 248 || inputFile.endsWith(QLatin1String(".pri"), Qt::CaseInsensitive)) { 248 QHash<QByteArray, QStringList> varMap; 249 bool ok = evaluateProFile(inputFile, cd.isVerbose(), &varMap); 250 if (ok) { 251 QStringList translations = varMap.value("TRANSLATIONS"); 252 if (translations.isEmpty()) { 253 qWarning("lrelease warning: Met no 'TRANSLATIONS' entry in" 254 " project file '%s'\n", 255 qPrintable(inputFile)); 256 } else { 257 foreach (const QString &trans, translations) 258 if (!releaseTsFile(trans, cd, removeIdentical)) 259 return 1; 260 } 249 QFileInfo fi(inputFile); 250 ProFile pro(fi.absoluteFilePath()); 251 252 ProFileEvaluator visitor; 253 visitor.setVerbose(cd.isVerbose()); 254 255 if (!visitor.queryProFile(&pro)) { 256 qWarning("lrelease error: cannot read project file '%s'.", qPrintable(inputFile)); 257 continue; 258 } 259 if (!visitor.accept(&pro)) { 260 qWarning("lrelease error: cannot process project file '%s'.", qPrintable(inputFile)); 261 continue; 262 } 263 264 QStringList translations = visitor.values(QLatin1String("TRANSLATIONS")); 265 if (translations.isEmpty()) { 266 qWarning("lrelease warning: Met no 'TRANSLATIONS' entry in" 267 " project file '%s'\n", 268 qPrintable(inputFile)); 261 269 } else { 262 qWarning("error: lrelease encountered project file functionality that is currently not supported.\n"263 "You might want to consider using TS files as input instead of a project file.\n"264 "Try the following syntax:\n"265 " lrelease [options] ts-files [-qm qm-file]\n");270 QDir proDir(fi.absolutePath()); 271 foreach (const QString &trans, translations) 272 if (!releaseTsFile(QFileInfo(proDir, trans).filePath(), cd, removeIdentical)) 273 return 1; 266 274 } 267 275 } else {
Note:
See TracChangeset
for help on using the changeset viewer.