forked from qt-creator/qt-creator
ProjectExplorer: Move Runnable/Connection model into class
Somewhat better encapsulation. Removes the "false" sharing of Concept implementations, and takes the opportunity to change the operator==() into a 'canReUseOutputPane' function to be explicit about its only use. This doesn't solve the change in output pane reuse behavior yet, but provides the base to put the required logic into canReUseOutputPane, as opposed to abusing the general equality concept. Change-Id: Id9e4e6b8601c5fcf40a252fb423c2c4c2b74ddb6 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -668,7 +668,7 @@ bool RunControl::canReUseOutputPane(const RunControl *other) const
|
||||
if (other->isRunning())
|
||||
return false;
|
||||
|
||||
return d->runnable == other->d->runnable;
|
||||
return d->runnable.canReUseOutputPane(other->d->runnable);
|
||||
}
|
||||
|
||||
ProcessHandle RunControl::applicationProcessHandle() const
|
||||
@@ -771,9 +771,9 @@ void RunControl::appendMessage(const QString &msg, Utils::OutputFormat format)
|
||||
emit appendMessage(this, msg, format);
|
||||
}
|
||||
|
||||
bool Runnable::operator==(const Runnable &other) const
|
||||
bool Runnable::canReUseOutputPane(const Runnable &other) const
|
||||
{
|
||||
return d ? d->equals(other.d) : (other.d.get() == 0);
|
||||
return d ? d->canReUseOutputPane(other.d) : (other.d.get() == 0);
|
||||
}
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
Reference in New Issue
Block a user