forked from qt-creator/qt-creator
ValgrindRunner: Rename finished() into done()
Add bool success arg into done signal. Change-Id: Id39a727860e0e705513917f69ecd38e455078b5a Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -40,7 +40,7 @@ CallgrindToolRunner::CallgrindToolRunner(RunControl *runControl)
|
|||||||
connect(&m_runner, &ValgrindRunner::valgrindStarted, this, [this](qint64 pid) {
|
connect(&m_runner, &ValgrindRunner::valgrindStarted, this, [this](qint64 pid) {
|
||||||
m_pid = pid;
|
m_pid = pid;
|
||||||
});
|
});
|
||||||
connect(&m_runner, &ValgrindRunner::finished, this, [this] {
|
connect(&m_runner, &ValgrindRunner::done, this, [this] {
|
||||||
triggerParse();
|
triggerParse();
|
||||||
emit parserDataReady(this);
|
emit parserDataReady(this);
|
||||||
});
|
});
|
||||||
|
@@ -41,7 +41,7 @@ ValgrindToolRunner::ValgrindToolRunner(RunControl *runControl)
|
|||||||
[this](const QString &msg, Utils::OutputFormat format) { appendMessage(msg, format); });
|
[this](const QString &msg, Utils::OutputFormat format) { appendMessage(msg, format); });
|
||||||
connect(&m_runner, &ValgrindRunner::processErrorReceived,
|
connect(&m_runner, &ValgrindRunner::processErrorReceived,
|
||||||
this, &ValgrindToolRunner::receiveProcessError);
|
this, &ValgrindToolRunner::receiveProcessError);
|
||||||
connect(&m_runner, &ValgrindRunner::finished,
|
connect(&m_runner, &ValgrindRunner::done,
|
||||||
this, &ValgrindToolRunner::runnerFinished);
|
this, &ValgrindToolRunner::runnerFinished);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -110,9 +110,10 @@ public:
|
|||||||
emit q->valgrindStarted(process->processId());
|
emit q->valgrindStarted(process->processId());
|
||||||
});
|
});
|
||||||
connect(process, &Process::done, this, [this, process] {
|
connect(process, &Process::done, this, [this, process] {
|
||||||
if (process->result() != ProcessResult::FinishedWithSuccess)
|
const bool success = process->result() == ProcessResult::FinishedWithSuccess;
|
||||||
|
if (!success)
|
||||||
emit q->processErrorReceived(process->errorString(), process->error());
|
emit q->processErrorReceived(process->errorString(), process->error());
|
||||||
emit q->finished();
|
emit q->done(success);
|
||||||
});
|
});
|
||||||
connect(process, &Process::readyReadStandardOutput, this, [this, process] {
|
connect(process, &Process::readyReadStandardOutput, this, [this, process] {
|
||||||
emit q->appendMessage(process->readAllStandardOutput(), StdOutFormat);
|
emit q->appendMessage(process->readAllStandardOutput(), StdOutFormat);
|
||||||
@@ -224,7 +225,7 @@ void ValgrindRunner::waitForFinished() const
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
QEventLoop loop;
|
QEventLoop loop;
|
||||||
connect(this, &ValgrindRunner::finished, &loop, &QEventLoop::quit);
|
connect(this, &ValgrindRunner::done, &loop, &QEventLoop::quit);
|
||||||
loop.exec();
|
loop.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -47,7 +47,7 @@ signals:
|
|||||||
void logMessageReceived(const QByteArray &);
|
void logMessageReceived(const QByteArray &);
|
||||||
void processErrorReceived(const QString &, QProcess::ProcessError);
|
void processErrorReceived(const QString &, QProcess::ProcessError);
|
||||||
void valgrindStarted(qint64 pid);
|
void valgrindStarted(qint64 pid);
|
||||||
void finished();
|
void done(bool success);
|
||||||
|
|
||||||
// Parser's signals
|
// Parser's signals
|
||||||
void status(const Valgrind::XmlProtocol::Status &status);
|
void status(const Valgrind::XmlProtocol::Status &status);
|
||||||
|
@@ -33,7 +33,7 @@ int main(int argc, char *argv[])
|
|||||||
runner.setValgrindCommand({VALGRIND_FAKE_PATH,
|
runner.setValgrindCommand({VALGRIND_FAKE_PATH,
|
||||||
{"-i", PARSERTESTS_DATA_DIR "/memcheck-output-sample1.xml"}});
|
{"-i", PARSERTESTS_DATA_DIR "/memcheck-output-sample1.xml"}});
|
||||||
ModelDemo demo(&runner);
|
ModelDemo demo(&runner);
|
||||||
QObject::connect(&runner, &ValgrindRunner::finished, &demo, &ModelDemo::finished);
|
QObject::connect(&runner, &ValgrindRunner::done, &demo, &ModelDemo::finished);
|
||||||
ErrorListModel model;
|
ErrorListModel model;
|
||||||
QObject::connect(&runner, &ValgrindRunner::error, &model, &ErrorListModel::addError,
|
QObject::connect(&runner, &ValgrindRunner::error, &model, &ErrorListModel::addError,
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
|
Reference in New Issue
Block a user