Commit a8bdc80a authored by Sandro Knauß's avatar Sandro Knauß
Browse files

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

FIX[messagecomposer/cryptocomposertests]: Use EncryptJob exec instead of async variant to pass tests.
parent 5959e5b3
Pipeline #49418 failed with stage
in 4 minutes and 44 seconds
......@@ -235,6 +235,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) {
if (result.error()) {
setError(result.error().code());
......@@ -247,4 +248,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