Changeset 769 for trunk/tools/linguist/lupdate/main.cpp
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/tools/linguist/lupdate/main.cpp
r651 r769 137 137 138 138 static void updateTsFiles(const Translator &fetchedTor, const QStringList &tsFileNames, 139 const QByteArray &codecForTr, const QString &sourceLanguage, const QString &targetLanguage,139 bool setCodec, const QString &sourceLanguage, const QString &targetLanguage, 140 140 UpdateOptions options, bool *fail) 141 141 { … … 155 155 tor.resolveDuplicates(); 156 156 cd.clearErrors(); 157 if ( !codecForTr.isEmpty() && codecForTr != tor.codecName())157 if (setCodec && fetchedTor.codec() != tor.codec()) 158 158 qWarning("lupdate warning: Codec for tr() '%s' disagrees with " 159 159 "existing file's codec '%s'. Expect trouble.", 160 codecForTr.constData(), tor.codecName().constData());160 fetchedTor.codecName().constData(), tor.codecName().constData()); 161 161 if (!targetLanguage.isEmpty() && targetLanguage != tor.languageCode()) 162 162 qWarning("lupdate warning: Specified target language '%s' disagrees with " … … 168 168 qPrintable(sourceLanguage), qPrintable(tor.sourceLanguageCode())); 169 169 } else { 170 if ( !codecForTr.isEmpty())171 tor.setCodec Name(codecForTr);170 if (setCodec) 171 tor.setCodec(fetchedTor.codec()); 172 172 if (!targetLanguage.isEmpty()) 173 173 tor.setLanguageCode(targetLanguage); … … 191 191 theseOptions |= NoLocations; 192 192 Translator out = merge(tor, fetchedTor, theseOptions, err); 193 if ( !codecForTr.isEmpty())194 out.setCodec Name(codecForTr);193 if (setCodec) 194 out.setCodec(fetchedTor.codec()); 195 195 196 196 if ((options & Verbose) && !err.isEmpty()) { … … 375 375 } 376 376 Translator tor; 377 QByteArray codecForTr;377 bool setCodec = false; 378 378 QStringList tmp = visitor.values(QLatin1String("CODEC")) 379 379 + visitor.values(QLatin1String("DEFAULTCODEC")) 380 380 + visitor.values(QLatin1String("CODECFORTR")); 381 381 if (!tmp.isEmpty()) { 382 codecForTr = tmp.last().toLatin1();383 tor.setCodecName(codecForTr);382 tor.setCodecName(tmp.last().toLatin1()); 383 setCodec = true; 384 384 } 385 385 processProject(false, pfi, visitor, options, codecForSource, 386 386 targetLanguage, sourceLanguage, &tor, fail); 387 updateTsFiles(tor, tsFiles, codecForTr, sourceLanguage, targetLanguage, options, fail);387 updateTsFiles(tor, tsFiles, setCodec, sourceLanguage, targetLanguage, options, fail); 388 388 continue; 389 389 } … … 658 658 fetchedTor.setCodecName(codecForTr); 659 659 processSources(fetchedTor, sourceFiles, cd); 660 updateTsFiles(fetchedTor, tsFileNames, codecForTr,660 updateTsFiles(fetchedTor, tsFileNames, !codecForTr.isEmpty(), 661 661 sourceLanguage, targetLanguage, options, &fail); 662 662 } else { … … 670 670 processProjects(true, true, proFiles, options, QByteArray(), 671 671 targetLanguage, sourceLanguage, &fetchedTor, &fail); 672 updateTsFiles(fetchedTor, tsFileNames, codecForTr,672 updateTsFiles(fetchedTor, tsFileNames, !codecForTr.isEmpty(), 673 673 sourceLanguage, targetLanguage, options, &fail); 674 674 } else {
Note:
See TracChangeset
for help on using the changeset viewer.