From 54c4fd16d1832fcce05aa9e471a4acebff0e3269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Fri, 29 Apr 2022 11:55:47 +0200 Subject: [PATCH] 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 --- lang/qt/src/qgpgmerefreshsmimekeysjob.cpp | 15 ++++++--------- lang/qt/src/qgpgmerefreshsmimekeysjob.h | 1 - 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/lang/qt/src/qgpgmerefreshsmimekeysjob.cpp b/lang/qt/src/qgpgmerefreshsmimekeysjob.cpp index 81257d55..84bf0245 100644 --- a/lang/qt/src/qgpgmerefreshsmimekeysjob.cpp +++ b/lang/qt/src/qgpgmerefreshsmimekeysjob.cpp @@ -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()) { diff --git a/lang/qt/src/qgpgmerefreshsmimekeysjob.h b/lang/qt/src/qgpgmerefreshsmimekeysjob.h index aa2d5b73..b5b70e99 100644 --- a/lang/qt/src/qgpgmerefreshsmimekeysjob.h +++ b/lang/qt/src/qgpgmerefreshsmimekeysjob.h @@ -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: