[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/kdepim/enterprise4/kdepim/kleopatra/crypto
From: Christoph Schleifenbaum <christoph () kdab ! net>
Date: 2010-10-26 16:09:29
Message-ID: 20101026160929.87E01AC89A () svn ! kde ! org
[Download RAW message or body]
SVN commit 1190014 by cschleifenbaum:
Show the output for all format functions. Only when there's an error code.
M +21 -4 decryptverifytask.cpp
--- branches/kdepim/enterprise4/kdepim/kleopatra/crypto/decryptverifytask.cpp \
#1190013:1190014 @@ -454,8 +454,11 @@
return res;
}
-static QString formatVerificationResultDetails( const VerificationResult & res, \
const DecryptVerifyResult::SenderInfo & info ) +static QString \
formatVerificationResultDetails( const VerificationResult & res, const \
DecryptVerifyResult::SenderInfo & info, const QString& errorString ) {
+ if( (res.error().code() == GPG_ERR_EIO || res.error().code() == GPG_ERR_NO_DATA) \
&& !errorString.isEmpty() ) + return i18n( "Input error: %1", errorString );
+
const std::vector<Signature> sigs = res.signatures();
const std::vector<Key> signers = KeyCache::instance()->findSigners( res );
QString details;
@@ -470,7 +473,7 @@
static QString formatDecryptionResultDetails( const DecryptionResult & res, const \
std::vector<Key> & recipients, const QString& errorString ) {
- if( !errorString.isEmpty() )
+ if( (res.error().code() == GPG_ERR_EIO || res.error().code() == GPG_ERR_NO_DATA) \
&& !errorString.isEmpty() ) return i18n( "Input error: %1", errorString );
if ( res.isNull() || !res.error() || res.error().isCanceled() )
@@ -514,7 +517,7 @@
const QString drDetails = formatDecryptionResultDetails( dr, recipients, \
errorString );
if ( IsErrorOrCanceled( dr ) || !relevantInDecryptVerifyContext( vr ) )
return drDetails;
- return drDetails + ( drDetails.isEmpty() ? "" : "<br/>" ) + \
formatVerificationResultDetails( vr, info ); + return drDetails + ( \
drDetails.isEmpty() ? "" : "<br/>" ) + formatVerificationResultDetails( vr, info, \
errorString ); }
} // anon namespace
@@ -713,7 +716,7 @@
if ( d->isDecryptOnly() )
return formatDecryptionResultDetails( d->m_decryptionResult, \
KeyCache::instance()->findRecipients( d->m_decryptionResult ), errorString() ); if ( \
d->isVerifyOnly() )
- return formatVerificationResultDetails( d->m_verificationResult, \
d->makeSenderInfo() ); + return formatVerificationResultDetails( \
d->m_verificationResult, d->makeSenderInfo(), errorString() ); return \
formatDecryptVerifyResultDetails( d->m_decryptionResult, d->m_verificationResult, \
KeyCache::instance()->findRecipients( d->m_decryptionResult ), d->makeSenderInfo(), \
errorString() ); @@ -986,6 +989,13 @@
}
}
+ const int drErr = result.error().code();
+ const QString errorString = m_output->errorString();
+ if ( (drErr == GPG_ERR_EIO || drErr == GPG_ERR_NO_DATA) && \
!errorString.isEmpty() ) { + emitResult( q->fromDecryptResult( result.error(), \
errorString, auditLog ) ); + return;
+ }
+
emitResult( q->fromDecryptResult( result, plainText, auditLog ) );
}
@@ -1131,6 +1141,13 @@
}
}
+ const int drErr = result.error().code();
+ const QString errorString = m_output->errorString();
+ if ( (drErr == GPG_ERR_EIO || drErr == GPG_ERR_NO_DATA) && \
!errorString.isEmpty() ) { + emitResult( q->fromDecryptResult( result.error(), \
errorString, auditLog ) ); + return;
+ }
+
emitResult( q->fromVerifyOpaqueResult( result, plainText, auditLog ) );
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic