Commit f600fba6 authored by Sandro Knauß's avatar Sandro Knauß

FIX[messagecomposer/cryptocomposertests]: Use EncryptJob exec instead of async...

FIX[messagecomposer/cryptocomposertests]: Use EncryptJob exec instead of async variant to pass tests.
parent 47b04b9c
......@@ -234,6 +234,7 @@ void EncryptJob::process()
qCDebug(MESSAGECOMPOSER_LOG) << "got backend, starting job";
QGpgME::EncryptJob *eJob = proto->encryptJob(!d->binaryHint(d->format), d->format == Kleo::InlineOpenPGPFormat);
/*
QObject::connect(eJob, &QGpgME::EncryptJob::result, this, [this, d](const GpgME::EncryptionResult &result,
const QByteArray &cipherText,
const QString &auditLogAsHtml, const GpgME::Error &auditLogError) {
......@@ -250,4 +251,19 @@ void EncryptJob::process()
emitResult();
});
eJob->start(d->keys, content, true);
*/
//TODO: use async GPG again!!!
QByteArray cipherText;
auto result = eJob->exec(d->keys, content, true, cipherText);
if (result.error()) {
setError(result.error().code());
setErrorText(QString::fromLocal8Bit(result.error().asString()));
emitResult();
return;
}
d->resultContent = MessageComposer::Util::composeHeadersAndBody(d->content, cipherText, d->format, false);
emitResult();
}
Markdown is supported
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