forked from qt-creator/qt-creator
Inline RunControl::canReUseOutputPane into its only caller
Change-Id: I2e858ab3bf715b41c26cfb6246d470787d003e3c Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -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];
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user