Inline RunControl::canReUseOutputPane into its only caller

Change-Id: I2e858ab3bf715b41c26cfb6246d470787d003e3c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
hjk
2018-05-29 14:23:07 +02:00
parent bb28b10add
commit 772098c710
3 changed files with 9 additions and 14 deletions

View File

@@ -411,8 +411,15 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc)
this, &AppOutputPane::appendMessage);
// First look if we can reuse a tab
const int tabIndex = Utils::indexOf(m_runControlTabs, [rc](const RunControlTab &tab) {
return rc->canReUseOutputPane(tab.runControl);
const Runnable thisRunnable = rc->runnable();
const int tabIndex = Utils::indexOf(m_runControlTabs, [&](const RunControlTab &tab) {
if (!tab.runControl || tab.runControl->isRunning())
return false;
const Runnable otherRunnable = tab.runControl->runnable();
return thisRunnable.executable == otherRunnable.executable
&& thisRunnable.commandLineArguments == otherRunnable.commandLineArguments
&& thisRunnable.workingDirectory == otherRunnable.workingDirectory
&& thisRunnable.environment == otherRunnable.environment;
});
if (tabIndex != -1) {
RunControlTab &tab = m_runControlTabs[tabIndex];