From 7d962189ae730a822dc505e8dc32115d886f1f6a Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Fri, 18 Jun 2010 20:17:39 +0200
Subject: [PATCH] make ProMessageHandler connect directly to the message
 manager

that way the users don't have to duplicate the connect everywhere.
as a side effect, MaemoPackageContents will have error reporting now.
---
 src/plugins/qt4projectmanager/profilereader.cpp | 11 +++++++++++
 src/plugins/qt4projectmanager/profilereader.h   |  2 +-
 src/plugins/qt4projectmanager/qt4project.cpp    |  3 ---
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/plugins/qt4projectmanager/profilereader.cpp b/src/plugins/qt4projectmanager/profilereader.cpp
index 79e5d98b3d7..a2ea7ff2dfa 100644
--- a/src/plugins/qt4projectmanager/profilereader.cpp
+++ b/src/plugins/qt4projectmanager/profilereader.cpp
@@ -29,6 +29,9 @@
 
 #include "profilereader.h"
 
+#include <coreplugin/icore.h>
+#include <coreplugin/messagemanager.h>
+
 #include <QtCore/QDir>
 #include <QtCore/QDebug>
 
@@ -43,6 +46,14 @@ static QString format(const QString &fileName, int lineNo, const QString &msg)
         return msg;
 }
 
+ProMessageHandler::ProMessageHandler(bool verbose)
+    : m_verbose(verbose)
+{
+    QObject::connect(this, SIGNAL(errorFound(QString)),
+                     Core::ICore::instance()->messageManager(), SLOT(printToOutputPane(QString)),
+                     Qt::QueuedConnection);
+}
+
 void ProMessageHandler::parseError(const QString &fileName, int lineNo, const QString &msg)
 {
     emit errorFound(format(fileName, lineNo, msg));
diff --git a/src/plugins/qt4projectmanager/profilereader.h b/src/plugins/qt4projectmanager/profilereader.h
index abea88c345b..c133652586f 100644
--- a/src/plugins/qt4projectmanager/profilereader.h
+++ b/src/plugins/qt4projectmanager/profilereader.h
@@ -46,7 +46,7 @@ class ProMessageHandler : public QObject,
     Q_OBJECT
 
 public:
-    ProMessageHandler(bool verbose = false) : m_verbose(verbose) {}
+    ProMessageHandler(bool verbose = false);
     virtual ~ProMessageHandler() {}
 
     virtual void aboutToEval(ProFile *, ProFile *, EvalFileType) {}
diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp
index edafb26dd3c..c56abe40fb5 100644
--- a/src/plugins/qt4projectmanager/qt4project.cpp
+++ b/src/plugins/qt4projectmanager/qt4project.cpp
@@ -937,9 +937,6 @@ ProFileReader *Qt4Project::createProFileReader(Qt4ProFileNode *qt4ProFileNode)
     ++m_proFileOptionRefCnt;
 
     ProFileReader *reader = new ProFileReader(m_proFileOption);
-    connect(reader, SIGNAL(errorFound(QString)),
-            this, SLOT(proFileParseError(QString)),
-            Qt::QueuedConnection);
 
     reader->setOutputDir(qt4ProFileNode->buildDir());
 
-- 
GitLab