diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2020-03-19 16:00:37 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2020-03-20 13:48:15 +0000 |
commit | 04a99c1de16e1d04bcc1908fec7464d15b421702 (patch) | |
tree | 1f298306aae0ae288bac75b0691c8968e6c72e6b /src/plugins/projectexplorer/appoutputpane.cpp | |
parent | 7158e676121767f43ac542cc3c958d8ed1279436 (diff) |
Remove the limitation that output formatters have to be exclusive
Introduce an aggregating output formatter that forwards its input to a
sub-formatter that feels responsible for it, or otherwise lets the base
class handle it.
Our output panes now use such an aggregating formatter.
In particular, this means that in the future, we won't have to stuff all
run control output formatting into the Qt output formatter anymore.
Change-Id: I5498f200a61db10ccff3ec8974c6825da7f7072d
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/appoutputpane.cpp')
-rw-r--r-- | src/plugins/projectexplorer/appoutputpane.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index d9261efa5e..cb24b7c1c2 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -154,7 +154,7 @@ AppOutputPane::RunControlTab::RunControlTab(RunControl *runControl, Core::Output runControl(runControl), window(w) { if (runControl && w) - w->setFormatter(runControl->outputFormatter()); + w->setFormatters(runControl->outputFormatters()); } AppOutputPane::AppOutputPane() : @@ -404,7 +404,7 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc) if (tab.runControl) tab.runControl->initiateFinish(); tab.runControl = rc; - tab.window->setFormatter(rc->outputFormatter()); + tab.window->setFormatters(rc->outputFormatters()); handleOldOutput(tab.window); @@ -743,8 +743,12 @@ void AppOutputPane::slotRunControlFinished() { auto *rc = qobject_cast<RunControl *>(sender()); QTimer::singleShot(0, this, [this, rc]() { slotRunControlFinished2(rc); }); - if (rc->outputFormatter()) - rc->outputFormatter()->flush(); + for (const RunControlTab &t : m_runControlTabs) { + if (t.runControl == rc) { + t.window->flush(); + break; + } + } } void AppOutputPane::slotRunControlFinished2(RunControl *sender) |