don't print warnings from parser & evaluator
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>
Wed, 7 Aug 2013 13:54:29 +0000 (15:54 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 12 Aug 2013 16:15:20 +0000 (18:15 +0200)
they are pretty much noise in lupdate context.
we still print error messages: the ones from the parser are always
genuine, while the ones from the evaluator are at least occasionally
helpful.

Task-number: QTBUG-28159
Change-Id: I6cdb11b51c0a3f569ec430f98a0068f933db903d
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
src/linguist/lrelease/main.cpp
src/linguist/lupdate/main.cpp

index 08d6b42..2d6b60a 100644 (file)
@@ -205,7 +205,10 @@ static void print(const QString &fileName, int lineNo, int type, const QString &
 class EvalHandler : public QMakeHandler {
 public:
     virtual void message(int type, const QString &msg, const QString &fileName, int lineNo)
-        { if (verbose) print(fileName, lineNo, type, msg); }
+    {
+        if (verbose && (type & CategoryMask) == ErrorMessage)
+            print(fileName, lineNo, type, msg);
+    }
 
     virtual void fileMessage(const QString &) {}
 
index 4992b4e..70402e5 100644 (file)
@@ -247,7 +247,10 @@ static void print(const QString &fileName, int lineNo, int type, const QString &
 class EvalHandler : public QMakeHandler {
 public:
     virtual void message(int type, const QString &msg, const QString &fileName, int lineNo)
-        { if (verbose) print(fileName, lineNo, type, msg); }
+    {
+        if (verbose && (type & CategoryMask) == ErrorMessage)
+            print(fileName, lineNo, type, msg);
+    }
 
     virtual void fileMessage(const QString &) {}