diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-06-03 16:03:52 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-06-03 16:06:23 (GMT) |
commit | 482159bddec1736a8854dc2db1b75cf856d00255 (patch) | |
tree | 26a411466ab467bf62ad937315ddb54dd6f50aaf /tools/linguist/lrelease | |
parent | 29e294aee281b7a4dcdd1277eef0fe1552015536 (diff) | |
download | Qt-482159bddec1736a8854dc2db1b75cf856d00255.zip Qt-482159bddec1736a8854dc2db1b75cf856d00255.tar.gz Qt-482159bddec1736a8854dc2db1b75cf856d00255.tar.bz2 |
don't use qWarning() - or even qFatal()! - gratuitously.
Task-number: QTBUG-8044
Diffstat (limited to 'tools/linguist/lrelease')
-rw-r--r-- | tools/linguist/lrelease/main.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/tools/linguist/lrelease/main.cpp b/tools/linguist/lrelease/main.cpp index 266474e..df0b430 100644 --- a/tools/linguist/lrelease/main.cpp +++ b/tools/linguist/lrelease/main.cpp @@ -55,6 +55,8 @@ #include <QtCore/QStringList> #include <QtCore/QTextStream> +#include <iostream> + QT_USE_NAMESPACE #ifdef QT_BOOTSTRAPPED @@ -106,7 +108,7 @@ static bool loadTsFile(Translator &tor, const QString &tsFileName, bool /* verbo ConversionData cd; bool ok = tor.load(tsFileName, cd, QLatin1String("auto")); if (!ok) { - qWarning("lrelease error: %s\n", qPrintable(cd.error())); + std::cerr << "lrelease error: " << qPrintable(cd.error()) << std::endl; } else { if (!cd.errors().isEmpty()) printOut(cd.error()); @@ -130,8 +132,8 @@ static bool releaseTranslator(Translator &tor, const QString &qmFileName, QFile file(qmFileName); if (!file.open(QIODevice::WriteOnly)) { - qWarning("lrelease error: cannot create '%s': %s\n", - qPrintable(qmFileName), qPrintable(file.errorString())); + std::cerr << "lrelease error: cannot create '" << qPrintable(qmFileName) + << "': " << qPrintable(file.errorString()) << std::endl; return false; } @@ -140,8 +142,8 @@ static bool releaseTranslator(Translator &tor, const QString &qmFileName, file.close(); if (!ok) { - qWarning("lrelease error: cannot save '%s': %s\n", - qPrintable(qmFileName), qPrintable(cd.error())); + std::cerr << "lrelease error: cannot save '" << qPrintable(qmFileName) + << "': " << qPrintable(cd.error()) << std::endl; } else if (!cd.errors().isEmpty()) { printOut(cd.error()); } @@ -253,19 +255,20 @@ int main(int argc, char **argv) visitor.setVerbose(cd.isVerbose()); if (!visitor.queryProFile(&pro)) { - qWarning("lrelease error: cannot read project file '%s'.", qPrintable(inputFile)); + std::cerr << "lrelease error: cannot read project file '" + << qPrintable(inputFile) << "'.\n"; continue; } if (!visitor.accept(&pro)) { - qWarning("lrelease error: cannot process project file '%s'.", qPrintable(inputFile)); + std::cerr << "lrelease error: cannot process project file '" + << qPrintable(inputFile) << "'.\n"; continue; } QStringList translations = visitor.values(QLatin1String("TRANSLATIONS")); if (translations.isEmpty()) { - qWarning("lrelease warning: Met no 'TRANSLATIONS' entry in" - " project file '%s'\n", - qPrintable(inputFile)); + std::cerr << "lrelease warning: Met no 'TRANSLATIONS' entry in project file '" + << qPrintable(inputFile) << "'\n"; } else { QDir proDir(fi.absolutePath()); foreach (const QString &trans, translations) |