diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-01 00:37:02 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-01 00:37:02 +0000 |
commit | cc29364f06178f8f6b457384f2ec37a042bd9d43 (patch) | |
tree | 7c77a3184c698bbf9d98cef09fb1ba8124daceba /kmail/messagecomposer.cpp | |
parent | 4f6c584bacc8c3c694228f36ada3de77a76614a6 (diff) | |
download | tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.tar.gz tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.zip |
* Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch
* Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed
* Added journal read support to the CalDAV resource
* Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/messagecomposer.cpp')
-rw-r--r-- | kmail/messagecomposer.cpp | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/kmail/messagecomposer.cpp b/kmail/messagecomposer.cpp index 8d9950738..8b3f1c5c4 100644 --- a/kmail/messagecomposer.cpp +++ b/kmail/messagecomposer.cpp @@ -86,6 +86,7 @@ #include <gpgmepp/context.h> #include <algorithm> +#include <sstream> #include <memory> // ## keep default values in sync with configuredialog.cpp, Security::CryptoTab::setup() @@ -612,11 +613,8 @@ void MessageComposer::chiasmusEncryptAllAttachments() { part->setTypeStr( "application" ); part->setSubtypeStr( "vnd.de.bund.bsi.chiasmus" ); part->setName( filename + ".xia" ); - // this is taken from kmmsgpartdlg.cpp: - TQCString encoding = KMMsgBase::autoDetectCharset( part->charset(), KMMessage::preferredCharsets(), filename ); - if ( encoding.isEmpty() ) - encoding = "utf-8"; - const TQCString enc_name = KMMsgBase::encodeRFC2231String( filename + ".xia", encoding ); + const TQCString enc_name = KMMsgBase::encodeRFC2231StringAutoDetectCharset( + filename + ".xia", part->charset() ); const TQCString cDisp = "attachment;\n\tfilename" + ( TQString( enc_name ) != filename + ".xia" ? "*=" + enc_name @@ -2146,8 +2144,14 @@ void MessageComposer::pgpSignedMsg( const TQByteArray& cText, Kleo::CryptoMessag mSignature = TQByteArray(); const std::vector<GpgME::Key> signingKeys = mKeyResolver->signingKeys( format ); - - assert( !signingKeys.empty() ); + if ( signingKeys.empty() ) { + KMessageBox::sorry( mComposeWin, + i18n("This message could not be signed, " + "since no valid signing keys have been found; " + "this should actually never happen, " + "please report this bug.") ); + return; + } // TODO: ASync call? Likely, yes :-) const Kleo::CryptoBackendFactory * cpf = Kleo::CryptoBackendFactory::instance(); @@ -2171,6 +2175,11 @@ void MessageComposer::pgpSignedMsg( const TQByteArray& cText, Kleo::CryptoMessag TQByteArray signature; const GpgME::SigningResult res = job->exec( signingKeys, cText, signingMode( format ), signature ); + { + std::stringstream ss; + ss << res; + kdDebug(5006) << ss.str().c_str() << endl; + } if ( res.error().isCanceled() ) { kdDebug() << "signing was canceled by user" << endl; return; @@ -2182,6 +2191,7 @@ void MessageComposer::pgpSignedMsg( const TQByteArray& cText, Kleo::CryptoMessag } if ( GlobalSettings::showGnuPGAuditLogAfterSuccessfulSignEncrypt() ) + if ( Kleo::MessageBox::showAuditLogButton( job.get() ) ) Kleo::MessageBox::auditLog( 0, job.get(), i18n("GnuPG Audit Log for Signing Operation") ); mSignature = signature; @@ -2219,6 +2229,11 @@ Kpgp::Result MessageComposer::pgpEncryptedMsg( TQByteArray & encryptedBody, const GpgME::EncryptionResult res = job->exec( encryptionKeys, cText, true /* we do ownertrust ourselves */, encryptedBody ); + { + std::stringstream ss; + ss << res; + kdDebug(5006) << ss.str().c_str() << endl; + } if ( res.error().isCanceled() ) { kdDebug() << "encryption was canceled by user" << endl; return Kpgp::Canceled; @@ -2230,6 +2245,7 @@ Kpgp::Result MessageComposer::pgpEncryptedMsg( TQByteArray & encryptedBody, } if ( GlobalSettings::showGnuPGAuditLogAfterSuccessfulSignEncrypt() ) + if ( Kleo::MessageBox::showAuditLogButton( job.get() ) ) Kleo::MessageBox::auditLog( 0, job.get(), i18n("GnuPG Audit Log for Encryption Operation") ); return Kpgp::Ok; @@ -2261,6 +2277,11 @@ Kpgp::Result MessageComposer::pgpSignedAndEncryptedMsg( TQByteArray & encryptedB const std::pair<GpgME::SigningResult,GpgME::EncryptionResult> res = job->exec( signingKeys, encryptionKeys, cText, false, encryptedBody ); + { + std::stringstream ss; + ss << res.first << '\n' << res.second; + kdDebug(5006) << ss.str().c_str() << endl; + } if ( res.first.error().isCanceled() || res.second.error().isCanceled() ) { kdDebug() << "encrypt/sign was canceled by user" << endl; return Kpgp::Canceled; @@ -2275,6 +2296,7 @@ Kpgp::Result MessageComposer::pgpSignedAndEncryptedMsg( TQByteArray & encryptedB } if ( GlobalSettings::showGnuPGAuditLogAfterSuccessfulSignEncrypt() ) + if ( Kleo::MessageBox::showAuditLogButton( job.get() ) ) Kleo::MessageBox::auditLog( 0, job.get(), i18n("GnuPG Audit Log for Encryption Operation") ); return Kpgp::Ok; |