diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-06-03 18:03:52 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-06-03 18:06:23 +0200 |
commit | 482159bddec1736a8854dc2db1b75cf856d00255 (patch) | |
tree | 26a411466ab467bf62ad937315ddb54dd6f50aaf /tools/linguist/lupdate/qscript.g | |
parent | 29e294aee281b7a4dcdd1277eef0fe1552015536 (diff) |
don't use qWarning() - or even qFatal()! - gratuitously.
Task-number: QTBUG-8044
Diffstat (limited to 'tools/linguist/lupdate/qscript.g')
-rw-r--r-- | tools/linguist/lupdate/qscript.g | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/tools/linguist/lupdate/qscript.g b/tools/linguist/lupdate/qscript.g index a473500ad5..a07753c35d 100644 --- a/tools/linguist/lupdate/qscript.g +++ b/tools/linguist/lupdate/qscript.g @@ -90,6 +90,8 @@ #include <QtCore/qtextcodec.h> #include <QtCore/qvariant.h> +#include <iostream> + #include <ctype.h> #include <stdlib.h> #include <stdio.h> @@ -1630,13 +1632,13 @@ case $rule_number: { if ((name == QLatin1String("qsTranslate")) || (name == QLatin1String("QT_TRANSLATE_NOOP"))) { QVariantList args = sym(2).toList(); if (args.size() < 2) { - qWarning("%s:%d: %s() requires at least two arguments", - qPrintable(fileName), identLineNo, qPrintable(name)); + std::cerr << qPrintable(fileName) << ':' << identLineNo << ": " + << qPrintable(name) << "() requires at least two arguments.\n"; } else { if ((args.at(0).type() != QVariant::String) || (args.at(1).type() != QVariant::String)) { - qWarning("%s:%d: %s(): both arguments must be literal strings", - qPrintable(fileName), identLineNo, qPrintable(name)); + std::cerr << qPrintable(fileName) << ':' << identLineNo << ": " + << qPrintable(name) << "(): both arguments must be literal strings.\n"; } else { QString context = args.at(0).toString(); QString text = args.at(1).toString(); @@ -1650,12 +1652,12 @@ case $rule_number: { } else if ((name == QLatin1String("qsTr")) || (name == QLatin1String("QT_TR_NOOP"))) { QVariantList args = sym(2).toList(); if (args.size() < 1) { - qWarning("%s:%d: %s() requires at least one argument", - qPrintable(fileName), identLineNo, qPrintable(name)); + std::cerr << qPrintable(fileName) << ':' << identLineNo << ": " + << qPrintable(name) << "() requires at least one argument.\n"; } else { if (args.at(0).type() != QVariant::String) { - qWarning("%s:%d: %s(): text to translate must be a literal string", - qPrintable(fileName), identLineNo, qPrintable(name)); + std::cerr << qPrintable(fileName) << ':' << identLineNo << ": " + << qPrintable(name) << "(): text to translate must be a literal string.\n"; } else { QString context = QFileInfo(fileName).baseName(); QString text = args.at(0).toString(); @@ -2009,8 +2011,8 @@ bool loadQScript(Translator &translator, const QString &filename, ConversionData lexer.setCode(code, /*lineNumber=*/1); QScriptParser parser; if (!parser.parse(&lexer, filename, &translator)) { - qWarning("%s:%d: %s", qPrintable(filename), parser.errorLineNumber(), - qPrintable(parser.errorMessage())); + std::cerr << qPrintable(filename) << ':' << parser.errorLineNumber() << ": " + << qPrintable(parser.errorMessage()) << std::endl; return false; } |