Commit 1d266b65 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add info about finished job

parent e10ebf22
Pipeline #201347 passed with stage
in 19 minutes and 23 seconds
......@@ -44,7 +44,10 @@ void AkonadiDatabaseToolsJob::start()
mProcess = new QProcess(this);
mProcess->setProgram(QStandardPaths::findExecutable(QStringLiteral("akonadictl")));
mProcess->setArguments(QStringList() << QStringLiteral("vacuum"));
connect(mProcess, &QProcess::finished, this, &AkonadiDatabaseToolsJob::deleteLater);
connect(mProcess, &QProcess::finished, this, [this]() {
Q_EMIT finished();
deleteLater();
});
connect(mProcess, &QProcess::readyReadStandardError, this, [this]() {
Q_EMIT receivedStandardError(QLatin1String(mProcess->readAllStandardError()));
});
......@@ -60,7 +63,10 @@ void AkonadiDatabaseToolsJob::start()
mProcess = new QProcess(this);
mProcess->setProgram(QStandardPaths::findExecutable(QStringLiteral("akonadictl")));
mProcess->setArguments(QStringList() << QStringLiteral("fsck"));
connect(mProcess, &QProcess::finished, this, &AkonadiDatabaseToolsJob::deleteLater);
connect(mProcess, &QProcess::finished, this, [this]() {
Q_EMIT finished();
deleteLater();
});
connect(mProcess, &QProcess::readyReadStandardError, this, [this]() {
Q_EMIT receivedStandardError(QLatin1String(mProcess->readAllStandardError()));
});
......
......@@ -25,6 +25,7 @@ public:
Q_SIGNALS:
void receivedStandardError(const QString &str);
void receivedStandardOutput(const QString &str);
void finished();
private:
Q_REQUIRED_RESULT QString processExist() const;
......
......@@ -58,5 +58,8 @@ void AkonadiDatabaseToolsPluginInterface::exec()
job->setTool(mTool);
connect(job, &AkonadiDatabaseToolsJob::receivedStandardError, dlg, &AkonadiDatabaseToolsDialog::appendText);
connect(job, &AkonadiDatabaseToolsJob::receivedStandardOutput, dlg, &AkonadiDatabaseToolsDialog::appendText);
connect(job, &AkonadiDatabaseToolsJob::finished, dlg, [this, dlg]() {
dlg->appendText(i18n("Finished."));
});
job->start();
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment