From 215b28466682ae3d0f1a2ef26d7972ac8b63d7ab Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 3 Sep 2020 14:23:31 +0200 Subject: [PATCH] ProjectExplorer: Properly set up the output formatter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... for the app output window. Fixes: QTCREATORBUG-24560 Change-Id: I199d7b16f445db498027094792c6cf344d920a88 Reviewed-by: André Hartmann --- src/plugins/projectexplorer/appoutputpane.cpp | 9 ++++++--- src/plugins/projectexplorer/runcontrol.cpp | 9 +++++++-- src/plugins/projectexplorer/runcontrol.h | 3 ++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index 320cd5ac6e0..63a9377df74 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -154,8 +154,10 @@ void TabWidget::slotContextMenuRequested(const QPoint &pos) AppOutputPane::RunControlTab::RunControlTab(RunControl *runControl, Core::OutputWindow *w) : runControl(runControl), window(w) { - if (runControl && w) - w->setLineParsers(runControl->createOutputParsers()); + if (runControl && w) { + w->reset(); + runControl->setupFormatter(w->outputFormatter()); + } } AppOutputPane::AppOutputPane() : @@ -405,7 +407,8 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc) if (tab.runControl) tab.runControl->initiateFinish(); tab.runControl = rc; - tab.window->setLineParsers(rc->createOutputParsers()); + tab.window->reset(); + rc->setupFormatter(tab.window->outputFormatter()); handleOldOutput(tab.window); diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index a7d3a075fa9..a5b45af2ef8 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -824,7 +825,7 @@ void RunControlPrivate::showError(const QString &msg) q->appendMessage(msg + '\n', ErrorMessageFormat); } -QList RunControl::createOutputParsers() const +void RunControl::setupFormatter(OutputFormatter *formatter) const { QList parsers = OutputFormatterFactory::createFormatters(target()); if (const auto customParsersAspect @@ -834,7 +835,11 @@ QList RunControl::createOutputParsers() const parsers << parser; } } - return parsers; + formatter->setLineParsers(parsers); + Utils::FileInProjectFinder fileFinder; + fileFinder.setProjectDirectory(project()->projectDirectory()); + fileFinder.setProjectFiles(project()->files(Project::AllFiles)); + formatter->setFileFinder(fileFinder); } Utils::Id RunControl::runMode() const diff --git a/src/plugins/projectexplorer/runcontrol.h b/src/plugins/projectexplorer/runcontrol.h index 6926ec4c582..b609815363c 100644 --- a/src/plugins/projectexplorer/runcontrol.h +++ b/src/plugins/projectexplorer/runcontrol.h @@ -46,6 +46,7 @@ namespace Utils { class MacroExpander; class OutputLineParser; +class OutputFormatter; } // Utils namespace ProjectExplorer { @@ -238,7 +239,7 @@ public: Utils::FilePath targetFilePath() const; Utils::FilePath projectFilePath() const; - QList createOutputParsers() const; + void setupFormatter(Utils::OutputFormatter *formatter) const; Utils::Id runMode() const; const Runnable &runnable() const;