Revert 928247 which forward ported a fix from enterprise35 via

enterprise4 which I believe is wrong in all branches, but doesn't crash
in e35, probably. Kleo jobs auto-delete, and thus do not need to be
deleted again from KMail. The commit to e35 put the jobs in to auto_ptrs
in KMail, which in e35 probably delete the jobs before the event loop is
next reached (and thus before the job's deleteLater()) resulting in no
crash. In e4 and trunk, because of the newly added event loop wrapping
KleoJobExectuor, the deleteLater happens before the auto_ptr dtor
resulting in a crash in that.

Marc, am I missing something or does this need to be reverted in e35 and
e4 as well?

CCMAIL: mutz@kde.org

svn path=/trunk/KDE/kdepim/; revision=929169
wilder-work
Till Adam 17 years ago
parent 17d3106948
commit e043cb56a0
  1. 26
      objecttreeparser.cpp

@ -453,20 +453,18 @@ namespace KMail {
if ( doCheck && cryptProto ) {
GpgME::VerificationResult result;
if ( data ) { // detached
const std::auto_ptr<Kleo::VerifyDetachedJob> job( cryptProto->verifyDetachedJob() );
if ( job.get() ) {
if ( Kleo::VerifyDetachedJob * const job = cryptProto->verifyDetachedJob() ) {
KleoJobExecutor executor;
result = executor.exec( job.get(), signaturetext, cleartext );
result = executor.exec( job, signaturetext, cleartext );
messagePart.auditLogError = executor.auditLogError();
messagePart.auditLog = executor.auditLogAsHtml();
} else {
cryptPlugError = CANT_VERIFY_SIGNATURES;
}
} else { // opaque
const std::auto_ptr<Kleo::VerifyOpaqueJob> job( cryptProto->verifyOpaqueJob() );
if ( job.get() ) {
if ( Kleo::VerifyOpaqueJob * const job = cryptProto->verifyOpaqueJob() ) {
KleoJobExecutor executor;
result = executor.exec( job.get(), signaturetext, cleartext );
result = executor.exec( job, signaturetext, cleartext );
messagePart.auditLogError = executor.auditLogError();
messagePart.auditLog = executor.auditLogAsHtml();
} else {
@ -498,7 +496,7 @@ namespace KMail {
messagePart.isGoodSignature = true;
// get key for this signature
const std::auto_ptr<Kleo::KeyListJob> job( cryptProto->keyListJob() );
Kleo::KeyListJob *job = cryptProto->keyListJob();
std::vector<GpgME::Key> keys;
if ( signature.fingerprint() ) // if the fingerprint is empty, the keylisting would return all available keys
GpgME::KeyListResult keyListRes = job->exec( QStringList( QString::fromLatin1( signature.fingerprint() ) ),
@ -710,14 +708,14 @@ bool ObjectTreeParser::okDecryptMIME( partNode& data,
if ( mReader )
emit mReader->noDrag(); // in case pineentry pops up, don't let kmheaders start a drag afterwards
const std::auto_ptr<Kleo::DecryptVerifyJob> job( cryptProto->decryptVerifyJob() );
if ( !job.get() ) {
Kleo::DecryptVerifyJob* job = cryptProto->decryptVerifyJob();
if ( !job ) {
cryptPlugError = CANT_DECRYPT;
cryptProto = 0;
} else {
QByteArray plainText;
KleoJobExecutor executor;
const std::pair<GpgME::DecryptionResult,GpgME::VerificationResult> res = executor.exec( job.get(), ciphertext, plainText );
const std::pair<GpgME::DecryptionResult,GpgME::VerificationResult> res = executor.exec( job, ciphertext, plainText );
const GpgME::DecryptionResult decryptResult = res.first;
const GpgME::VerificationResult verifyResult = res.second;
signatureFound = verifyResult.signatures().size() > 0;
@ -1486,9 +1484,9 @@ namespace KMail {
const QByteArray certData = node->msgPart().bodyDecodedBinary();
const std::auto_ptr<Kleo::ImportJob> import( smimeCrypto->importJob() );
Kleo::ImportJob *import = smimeCrypto->importJob();
KleoJobExecutor executor;
const GpgME::ImportResult res = executor.exec( import.get(), certData );
const GpgME::ImportResult res = executor.exec( import, certData );
if ( res.error() ) {
htmlWriter()->queue( i18n( "Sorry, certificate could not be imported.<br />"
"Reason: %1", QString::fromLocal8Bit( res.error().asString() ) ) );
@ -1711,8 +1709,8 @@ bool ObjectTreeParser::decryptChiasmus( const QByteArray& data, QByteArray& body
GlobalSettings::setChiasmusDecryptionKey( selectorDlg.key() );
assert( !GlobalSettings::chiasmusDecryptionKey().isEmpty() );
const std::auto_ptr<Kleo::SpecialJob> job( chiasmus->specialJob( "x-decrypt", QMap<QString,QVariant>() ) );
if ( !job.get() ) {
Kleo::SpecialJob * job = chiasmus->specialJob( "x-decrypt", QMap<QString,QVariant>() );
if ( !job ) {
errorText = i18n( "Chiasmus backend does not offer the "
"\"x-decrypt\" function. Please report this bug." );
return false;

Loading…
Cancel
Save