diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2011-06-01 10:34:59 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2011-06-01 10:37:22 (GMT) |
commit | 0b92d6cc61a18ae18d254ac6ee463e74cb570db4 (patch) | |
tree | 205cfc3b4e1091a1c241ad75d47a27c23a7e87b7 /tools/linguist | |
parent | 72c31196fdba0cd297ed42cb35959b4b305296c7 (diff) | |
download | Qt-0b92d6cc61a18ae18d254ac6ee463e74cb570db4.zip Qt-0b92d6cc61a18ae18d254ac6ee463e74cb570db4.tar.gz Qt-0b92d6cc61a18ae18d254ac6ee463e74cb570db4.tar.bz2 |
use a printErr() function instead of std::cerr like in lupdate
Diffstat (limited to 'tools/linguist')
-rw-r--r-- | tools/linguist/lrelease/main.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/tools/linguist/lrelease/main.cpp b/tools/linguist/lrelease/main.cpp index b1beec8..8d2cf4a 100644 --- a/tools/linguist/lrelease/main.cpp +++ b/tools/linguist/lrelease/main.cpp @@ -55,8 +55,6 @@ #include <QtCore/QStringList> #include <QtCore/QTextStream> -#include <iostream> - QT_USE_NAMESPACE #ifdef QT_BOOTSTRAPPED @@ -84,6 +82,12 @@ static void printOut(const QString & out) stream << out; } +static void printErr(const QString & out) +{ + QTextStream stream(stderr); + stream << out; +} + static void printUsage() { printOut(LR::tr( @@ -119,7 +123,7 @@ static bool loadTsFile(Translator &tor, const QString &tsFileName, bool /* verbo ConversionData cd; bool ok = tor.load(tsFileName, cd, QLatin1String("auto")); if (!ok) { - std::cerr << qPrintable(LR::tr("lrelease error: %1").arg(cd.error())); + printErr(LR::tr("lrelease error: %1").arg(cd.error())); } else { if (!cd.errors().isEmpty()) printOut(cd.error()); @@ -143,7 +147,7 @@ static bool releaseTranslator(Translator &tor, const QString &qmFileName, QFile file(qmFileName); if (!file.open(QIODevice::WriteOnly)) { - std::cerr << qPrintable(LR::tr("lrelease error: cannot create '%1': %2\n") + printErr(LR::tr("lrelease error: cannot create '%1': %2\n") .arg(qmFileName, file.errorString())); return false; } @@ -153,7 +157,7 @@ static bool releaseTranslator(Translator &tor, const QString &qmFileName, file.close(); if (!ok) { - std::cerr << qPrintable(LR::tr("lrelease error: cannot save '%1': %2") + printErr(LR::tr("lrelease error: cannot save '%1': %2") .arg(qmFileName, cd.error())); } else if (!cd.errors().isEmpty()) { printOut(cd.error()); @@ -274,13 +278,13 @@ int main(int argc, char **argv) visitor.setVerbose(cd.isVerbose()); if (!visitor.queryProFile(&pro)) { - std::cerr << qPrintable(LR::tr( + printErr(LR::tr( "lrelease error: cannot read project file '%1'.\n") .arg(inputFile)); continue; } if (!visitor.accept(&pro)) { - std::cerr << qPrintable(LR::tr( + printErr(LR::tr( "lrelease error: cannot process project file '%1'.\n") .arg(inputFile)); continue; @@ -288,7 +292,7 @@ int main(int argc, char **argv) QStringList translations = visitor.values(QLatin1String("TRANSLATIONS")); if (translations.isEmpty()) { - std::cerr << qPrintable(LR::tr( + printErr(LR::tr( "lrelease warning: Met no 'TRANSLATIONS' entry in project file '%1'\n") .arg(inputFile)); } else { |