forked from qt-creator/qt-creator
QtcProcess: Introduce virtual emit* temporarily
Introduce emitStarted, emitFinished and emitErrorOccurred
virtual protected methods for QtcProcess subclasses.
It makes it easier to connect to self signals and
filter out the unneeded emissions. This is a temporary
change until QtcProcess is de-virtualized.
Amends ff68923846
Change-Id: I784676458e86314e092366e3b3b1244dfe2712f3
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -473,7 +473,7 @@ public:
|
||||
m_process->setParent(this);
|
||||
|
||||
connect(m_process.get(), &ProcessInterface::started,
|
||||
q, &QtcProcess::started);
|
||||
q, &QtcProcess::emitStarted);
|
||||
connect(m_process.get(), &ProcessInterface::finished,
|
||||
this, &QtcProcessPrivate::slotFinished);
|
||||
connect(m_process.get(), &ProcessInterface::errorOccurred,
|
||||
@@ -742,6 +742,21 @@ QtcProcess::~QtcProcess()
|
||||
delete d;
|
||||
}
|
||||
|
||||
void QtcProcess::emitStarted()
|
||||
{
|
||||
emit started();
|
||||
}
|
||||
|
||||
void QtcProcess::emitFinished()
|
||||
{
|
||||
emit finished();
|
||||
}
|
||||
|
||||
void QtcProcess::emitErrorOccurred(QProcess::ProcessError error)
|
||||
{
|
||||
emit errorOccurred(error);
|
||||
}
|
||||
|
||||
void QtcProcess::setProcessInterface(ProcessInterface *interface)
|
||||
{
|
||||
d->setProcessInterface(interface);
|
||||
@@ -1710,7 +1725,7 @@ void QtcProcessPrivate::slotFinished()
|
||||
m_stdOut.handleRest();
|
||||
m_stdErr.handleRest();
|
||||
|
||||
emit q->finished();
|
||||
q->emitFinished();
|
||||
}
|
||||
|
||||
void QtcProcessPrivate::handleError(QProcess::ProcessError error)
|
||||
@@ -1725,7 +1740,7 @@ void QtcProcessPrivate::handleError(QProcess::ProcessError error)
|
||||
if (m_eventLoop)
|
||||
m_eventLoop->quit();
|
||||
|
||||
emit q->errorOccurred(error);
|
||||
q->emitErrorOccurred(error);
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
|
||||
Reference in New Issue
Block a user