qt: Fix connection to readyReadStandardOutput signal

* lang/qt/src/qgpgmerefreshsmimekeysjob.h,
lang/qt/src/qgpgmerefreshsmimekeysjob.cpp
(QGpgMERefreshSMIMEKeysJob::slotStderr): Remove.
* lang/qt/src/qgpgmerefreshsmimekeysjob.cpp
(QGpgMERefreshSMIMEKeysJob::startAProcess): Handle
readyReadStandardOutput and readyReadStandardError signals with lambdas.
--

For now output stdout and stderr of gpgsm process as debug log. In
particular, this "adds" the missing slot slotStdout.

GnuPG-bug-id: 5951
This commit is contained in:
Ingo Klöcker 2022-04-29 11:55:47 +02:00
parent 9686258bd1
commit 54c4fd16d1
2 changed files with 6 additions and 10 deletions

View File

@ -152,10 +152,12 @@ GpgME::Error QGpgMERefreshSMIMEKeysJob::startAProcess()
connect(mProcess, SIGNAL(finished(int,QProcess::ExitStatus)),
SLOT(slotProcessExited(int,QProcess::ExitStatus)));
connect(mProcess, SIGNAL(readyReadStandardOutput()),
SLOT(slotStdout()));
connect(mProcess, &QProcess::readyReadStandardError,
this, &QGpgMERefreshSMIMEKeysJob::slotStderr);
connect(mProcess, &QProcess::readyReadStandardOutput, this, [this]() {
qCDebug(QGPGME_LOG) << "stdout:" << mProcess->readAllStandardOutput();
});
connect(mProcess, &QProcess::readyReadStandardError, this, [this]() {
qCDebug(QGPGME_LOG) << "stderr:" << mProcess->readAllStandardError();
});
mProcess->start();
if (!mProcess->waitForStarted()) {
@ -234,11 +236,6 @@ void QGpgMERefreshSMIMEKeysJob::slotStatus(QProcess *proc, const QString &type,
}
}
void QGpgMERefreshSMIMEKeysJob::slotStderr()
{
// implement? or not?
}
void QGpgMERefreshSMIMEKeysJob::slotProcessExited(int exitCode, QProcess::ExitStatus exitStatus)
{
if (!mError && !mPatternsToDo.empty()) {

View File

@ -65,7 +65,6 @@ private Q_SLOTS:
void slotCancel() Q_DECL_OVERRIDE;
void slotStatus(QProcess *, const QString &, const QStringList &);
void slotStderr();
void slotProcessExited(int exitCode, QProcess::ExitStatus exitStatus);
private: