diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index d6644e12553..3a27db85530 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -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]; diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index e5732da413a..fec46bded3f 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -1445,17 +1445,6 @@ Project *RunControl::project() const return d->project.data(); } -bool RunControl::canReUseOutputPane(const RunControl *other) const -{ - if (!other || other->isRunning()) - return false; - - return d->runnable.executable == other->d->runnable.executable - && d->runnable.commandLineArguments == other->d->runnable.commandLineArguments - && d->runnable.workingDirectory == other->d->runnable.workingDirectory - && d->runnable.environment == other->d->runnable.environment; -} - /*! A handle to the application process. diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index cb6f2b7e0be..aa31160cc53 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -504,7 +504,6 @@ public: RunConfiguration *runConfiguration() const; Project *project() const; - bool canReUseOutputPane(const RunControl *other) const; Utils::OutputFormatter *outputFormatter() const; Core::Id runMode() const;