diff --git a/src/plugins/projectexplorer/ioutputparser.cpp b/src/plugins/projectexplorer/ioutputparser.cpp index a57340d342249ea221a54224ad0c4e88f9a6c2a6..92eb9497c0cba339d6843fe4f73f78d8488f3bb5 100644 --- a/src/plugins/projectexplorer/ioutputparser.cpp +++ b/src/plugins/projectexplorer/ioutputparser.cpp @@ -34,7 +34,6 @@ namespace ProjectExplorer { IOutputParser::IOutputParser() : m_parser(0) { - } IOutputParser::~IOutputParser() @@ -57,6 +56,18 @@ void IOutputParser::appendOutputParser(IOutputParser *parser) this, SLOT(taskAdded(ProjectExplorer::TaskWindow::Task))); } +IOutputParser *IOutputParser::takeOutputParserChain() +{ + IOutputParser *parser = m_parser; + m_parser = 0; + return parser; +} + +IOutputParser *IOutputParser::childParser() const +{ + return m_parser; +} + void IOutputParser::stdOutput(const QString &line) { if (m_parser) diff --git a/src/plugins/projectexplorer/ioutputparser.h b/src/plugins/projectexplorer/ioutputparser.h index 0ed15aea940cc6f1ac5a7b6e2ad452a52a3c21f5..63af9d116aba0bc308c4f77a40b10453a590e79a 100644 --- a/src/plugins/projectexplorer/ioutputparser.h +++ b/src/plugins/projectexplorer/ioutputparser.h @@ -47,7 +47,15 @@ public: /// Append a subparser to this parser. /// IOutputParser will take ownership. - void appendOutputParser(IOutputParser *parser); + virtual void appendOutputParser(IOutputParser *parser); + + /// Remove the appended outputparser chain frm this parser. + /// This method transferes ownership of the parser chain to the caller! + IOutputParser *takeOutputParserChain(); + + /// Return the head of this parsers output parser children + /// IOutputParser keeps ownership! + IOutputParser *childParser() const; /// Called once for each line if standard output to parse. virtual void stdOutput(const QString &line); diff --git a/src/plugins/projectexplorer/metatypedeclarations.h b/src/plugins/projectexplorer/metatypedeclarations.h index c575324c369566e43f5dbdcbe8432e04741bb9af..99b46672dc78d23a33fc9fba69ab4029f4ba7b28 100644 --- a/src/plugins/projectexplorer/metatypedeclarations.h +++ b/src/plugins/projectexplorer/metatypedeclarations.h @@ -40,6 +40,7 @@ class SessionManager; class IApplicationOutput; class IOutputParser; class GlobalConfigManagerInterface; +struct TaskWindow::Task; namespace Internal { class CommandQObject; @@ -56,5 +57,6 @@ Q_DECLARE_METATYPE(ProjectExplorer::IOutputParser*) Q_DECLARE_METATYPE(ProjectExplorer::GlobalConfigManagerInterface*) Q_DECLARE_METATYPE(ProjectExplorer::TaskWindow::Task) +Q_DECLARE_METATYPE(QList<ProjectExplorer::TaskWindow::Task>) #endif // PROJECTEXPLORERMETATYPEDECLARATIONS_H diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index 00e0982c2f1c4bc03909110dab47d998cdafa19f..20272d320410207d4bae574fc8ea97ca1e3dab67 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -492,6 +492,7 @@ TaskWindow::TaskWindow() m_categoriesButton->setMenu(m_categoriesMenu); qRegisterMetaType<ProjectExplorer::TaskWindow::Task>("ProjectExplorer::TaskWindow::Task"); + qRegisterMetaType<QList<ProjectExplorer::TaskWindow::Task> >("QList<ProjectExplorer::TaskWindow::Task>"); updateActions(); } diff --git a/src/plugins/projectexplorer/taskwindow.h b/src/plugins/projectexplorer/taskwindow.h index 5595b299fcfdbfda7d0ecf8bd2ab9c06171fb6a5..e62310fa929d792aae137ba0d48264de0a6555e1 100644 --- a/src/plugins/projectexplorer/taskwindow.h +++ b/src/plugins/projectexplorer/taskwindow.h @@ -71,6 +71,10 @@ public: const QString &file_, int line_, const QString &category_) : type(type_), description(description_), file(file_), line(line_), category(category_) { } + Task(const Task &source) : + type(source.type), description(source.description), file(source.file), + line(source.line), category(source.category) + { } ~Task() { }