From e6c1681520bcc4163ab375167798d0fb34f0a16c Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Date: Wed, 6 Nov 2013 09:10:39 +0100
Subject: [PATCH] make ProFileReader verbose in precise mode

we rely on successful completion and accurate output from it, so it is
counterproductive to suppress error messages from it.

Change-Id: I35a5e085ff9813ba774f6f24feccb4d0f04019fe
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
---
 src/plugins/qtsupport/profilereader.cpp | 11 +++++++++--
 src/plugins/qtsupport/profilereader.h   |  6 +++++-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/plugins/qtsupport/profilereader.cpp b/src/plugins/qtsupport/profilereader.cpp
index ad4afe14097..6b122ca13c2 100644
--- a/src/plugins/qtsupport/profilereader.cpp
+++ b/src/plugins/qtsupport/profilereader.cpp
@@ -59,9 +59,10 @@ void ProMessageHandler::message(int type, const QString &msg, const QString &fil
         emit writeMessage(format(fileName, lineNo, msg), Core::MessageManager::NoModeSwitch);
 }
 
-void ProMessageHandler::fileMessage(const QString &)
+void ProMessageHandler::fileMessage(const QString &msg)
 {
-    // we ignore these...
+    if (m_verbose)
+        emit writeMessage(msg, Core::MessageManager::NoModeSwitch);
 }
 
 
@@ -78,6 +79,12 @@ ProFileReader::~ProFileReader()
         pf->deref();
 }
 
+void ProFileReader::setCumulative(bool on)
+{
+    ProMessageHandler::setVerbose(!on);
+    ProFileEvaluator::setCumulative(on);
+}
+
 void ProFileReader::aboutToEval(ProFile *, ProFile *pro, EvalFileType type)
 {
     if (m_ignoreLevel || (type != EvalProjectFile && type != EvalIncludeFile)) {
diff --git a/src/plugins/qtsupport/profilereader.h b/src/plugins/qtsupport/profilereader.h
index a8dc62a345a..531b7a3e633 100644
--- a/src/plugins/qtsupport/profilereader.h
+++ b/src/plugins/qtsupport/profilereader.h
@@ -49,7 +49,7 @@ class QTSUPPORT_EXPORT ProMessageHandler : public QObject, public QMakeHandler
     Q_OBJECT
 
 public:
-    ProMessageHandler(bool verbose = false);
+    ProMessageHandler(bool verbose = true);
     virtual ~ProMessageHandler() {}
 
     virtual void aboutToEval(ProFile *, ProFile *, EvalFileType) {}
@@ -57,6 +57,8 @@ public:
     virtual void message(int type, const QString &msg, const QString &fileName, int lineNo);
     virtual void fileMessage(const QString &msg);
 
+    void setVerbose(bool on) { m_verbose = on; }
+
 signals:
     void writeMessage(const QString &error, Core::MessageManager::PrintToOutputPaneFlags flag);
 
@@ -72,6 +74,8 @@ public:
     ProFileReader(ProFileGlobals *option, QMakeVfs *vfs);
     ~ProFileReader();
 
+    void setCumulative(bool on);
+
     QList<ProFile*> includeFiles() const;
 
     ProFile *proFileFor(const QString &name);
-- 
GitLab