ValgrindRunner: Get rid of errorString()

Change-Id: I5ef4d911f0986a721855525f6b2b7645253606fe
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2023-08-16 17:54:33 +02:00
parent 8dc3b0abc5
commit 2119a6c254
4 changed files with 6 additions and 14 deletions

View File

@@ -229,11 +229,6 @@ void ValgrindRunner::waitForFinished() const
loop.exec();
}
QString ValgrindRunner::errorString() const
{
return d->m_process.errorString();
}
bool ValgrindRunner::start()
{
return d->run();

View File

@@ -37,8 +37,6 @@ public:
void waitForFinished() const;
QString errorString() const;
bool start();
void stop();

View File

@@ -33,7 +33,12 @@ int main(int argc, char *argv[])
runner.setValgrindCommand({VALGRIND_FAKE_PATH,
{"-i", PARSERTESTS_DATA_DIR "/memcheck-output-sample1.xml"}});
ModelDemo demo(&runner);
QObject::connect(&runner, &ValgrindRunner::done, &demo, &ModelDemo::finished);
QObject::connect(&runner, &ValgrindRunner::processErrorReceived, &app, [](const QString &err) {
qDebug() << err;
});
QObject::connect(&runner, &ValgrindRunner::done, &app, [](bool success) {
qApp->exit(success ? 0 : 1);
});
ErrorListModel model;
QObject::connect(&runner, &ValgrindRunner::error, &model, &ErrorListModel::addError,
Qt::QueuedConnection);

View File

@@ -27,11 +27,6 @@ public:
Valgrind::XmlProtocol::StackModel* stackModel;
public Q_SLOTS:
void finished() {
qDebug() << runner->errorString();
qApp->exit(!runner->errorString().isEmpty());
}
void selectionChanged(const QItemSelection &sel, const QItemSelection &) {
if (sel.indexes().isEmpty())
return;
@@ -41,7 +36,6 @@ public Q_SLOTS:
stackModel->setError(err);
}
private:
Valgrind::ValgrindRunner *runner;
};