Merged revisions 972787 via svnmerge from

svn+ssh://tmcguire@svn.kde.org/home/kde/branches/kdepim/enterprise4/kdepim

................
  r972787 | winterz | 2009-05-25 19:16:03 +0200 (Mon, 25 May 2009) | 9 lines
  
  Merged revisions 972549 via svnmerge from 
  https://svn.kde.org/home/kde/branches/kdepim/enterprise/kdepim
  
  ........
    r972549 | mutz | 2009-05-25 05:42:20 -0400 (Mon, 25 May 2009) | 1 line
    
    Async KMail Reader (2/5): PartMetaData: add inProgress state and print corresponding messages (nothing sets this state yet)
  ........
................

svn path=/trunk/KDE/kdepim/; revision=986428
wilder-work
Thomas McGuire 17 years ago
parent 455a766048
commit 20eb730b59
  1. 97
      objecttreeparser.cpp
  2. 4
      objecttreeparser.h
  3. 2
      partmetadata.h

@ -112,7 +112,7 @@ using KPIMUtils::LinkLocator;
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <memory>
#include <cassert>
#include "chiasmuskeyselector.h"
namespace KMail {
@ -654,6 +654,25 @@ namespace KMail {
return bIsOpaqueSigned;
}
void ObjectTreeParser::writeDecryptionInProgressBlock()
{
kDebug(5006) << k_funcinfo << endl;
assert( mReader );
// PENDING(marc) find an animated icon here:
//const QString iconName = KGlobal::instance()->iconLoader()->iconPath( "decrypted", KIcon::Small );
const QString decryptedData = i18n("Encrypted data not shown");
PartMetaData messagePart;
messagePart.isDecryptable = true;
messagePart.isEncrypted = true;
messagePart.isSigned = false;
messagePart.inProgress = true;
htmlWriter()->queue( writeSigstatHeader( messagePart,
cryptoProtocol(),
QString() ) );
//htmlWriter()->queue( decryptedData );
htmlWriter()->queue( writeSigstatFooter( messagePart ) );
}
void ObjectTreeParser::writeDeferredDecryptionBlock()
{
kDebug();
@ -1568,14 +1587,13 @@ namespace KMail {
}
htmlWriter()->queue( "<b>" + i18n( "Certificate import details:" ) + "</b><br>" );
for ( std::vector<GpgME::Import>::const_iterator it = imports.begin() ; it != imports.end() ; ++it ) {
if ( (*it).error() )
if ( (*it).error() ) {
htmlWriter()->queue( i18nc( "Certificate import failed.", "Failed: %1 (%2)", (*it).fingerprint(),
QString::fromLocal8Bit( (*it).error().asString() ) ) );
else if ( (*it).status() & ~GpgME::Import::ContainedSecretKey ) {
QString::fromLocal8Bit( (*it).error().asString() ) ) );
} else if ( (*it).status() & ~GpgME::Import::ContainedSecretKey ) {
if ( (*it).status() & GpgME::Import::ContainedSecretKey ) {
htmlWriter()->queue( i18n( "New or changed: %1 (secret key available)", (*it).fingerprint() ) );
}
else {
} else {
htmlWriter()->queue( i18n( "New or changed: %1", (*it).fingerprint() ) );
}
}
@ -2201,42 +2219,51 @@ QString ObjectTreeParser::writeSigstatHeader( PartMetaData & block,
const QString & fromAddress,
const QString & filename )
{
const bool isSMIME = cryptProto && ( cryptProto == Kleo::CryptoBackendFactory::instance()->smime() );
QString signer = block.signer;
const bool isSMIME = cryptProto && ( cryptProto == Kleo::CryptoBackendFactory::instance()->smime() );
QString signer = block.signer;
QString htmlStr, simpleHtmlStr;
QString dir = ( QApplication::isRightToLeft() ? "rtl" : "ltr" );
QString cellPadding("cellpadding=\"1\"");
QString htmlStr, simpleHtmlStr;
QString dir = ( QApplication::isRightToLeft() ? "rtl" : "ltr" );
QString cellPadding("cellpadding=\"1\"");
if ( block.isEncapsulatedRfc822Message ) {
htmlStr += "<table cellspacing=\"1\" "+cellPadding+" class=\"rfc822\">"
"<tr class=\"rfc822H\"><td dir=\"" + dir + "\">";
if ( !filename.isEmpty() ) {
htmlStr += "<a href=\"" + QString("file:") +
KUrl::toPercentEncoding( filename ) + "\">" +
i18n("Encapsulated message") + "</a>";
} else {
htmlStr += i18n("Encapsulated message");
}
htmlStr += "</td></tr><tr class=\"rfc822B\"><td>";
}
if( block.isEncapsulatedRfc822Message )
{
htmlStr += "<table cellspacing=\"1\" "+cellPadding+" class=\"rfc822\">"
"<tr class=\"rfc822H\"><td dir=\"" + dir + "\">";
if( !filename.isEmpty() )
htmlStr += "<a href=\"" + QString("file:")
+ KUrl::toPercentEncoding( filename ) + "\">"
+ i18n("Encapsulated message") + "</a>";
else
htmlStr += i18n("Encapsulated message");
htmlStr += "</td></tr><tr class=\"rfc822B\"><td>";
if ( block.isEncrypted ) {
htmlStr += "<table cellspacing=\"1\" "+cellPadding+" class=\"encr\">"
"<tr class=\"encrH\"><td dir=\"" + dir + "\">";
if ( block.inProgress ) {
htmlStr += i18n("Please wait while the message is being decrypted...");
} else if ( block.isDecryptable ) {
htmlStr += i18n("Encrypted message");
} else {
htmlStr += i18n("Encrypted message (decryption not possible)");
if( !block.errorText.isEmpty() )
htmlStr += "<br />" + i18n("Reason: %1", block.errorText );
}
htmlStr += "</td></tr><tr class=\"encrB\"><td>";
}
if( block.isEncrypted )
{
htmlStr += "<table cellspacing=\"1\" "+cellPadding+" class=\"encr\">"
"<tr class=\"encrH\"><td dir=\"" + dir + "\">";
if( block.isDecryptable )
htmlStr += i18n("Encrypted message");
else {
htmlStr += i18n("Encrypted message (decryption not possible)");
if( !block.errorText.isEmpty() )
htmlStr += "<br />" + i18n("Reason: %1", block.errorText );
}
htmlStr += "</td></tr><tr class=\"encrB\"><td>";
if ( block.isSigned && block.inProgress ) {
block.signClass = "signInProgress";
htmlStr += "<table cellspacing=\"1\" "+cellPadding+" class=\"signInProgress\">"
"<tr class=\"signInProgressH\"><td dir=\"" + dir + "\">";
htmlStr += i18n("Please wait while the signature is being verified...");
htmlStr += "</td></tr><tr class=\"signInProgressB\"><td>";
}
simpleHtmlStr = htmlStr;
if( block.isSigned ) {
if ( block.isSigned && !block.inProgress ) {
QStringList& blockAddrs( block.signerMailAddresses );
// note: At the moment frameColor and showKeyInfos are
// used for CMS only but not for PGP signatures

@ -194,6 +194,10 @@ namespace KMail {
but we're deferring decryption for later. */
void writeDeferredDecryptionBlock();
/** Writes out the block that we use when the node is encrypted,
but we've just kicked off async decryption. */
void writeDecryptionInProgressBlock();
/** Returns the contents of the given multipart/encrypted
object. Data is decypted. May contain body parts. */
bool okDecryptMIME( partNode& data,

@ -34,6 +34,7 @@ namespace KMail {
isGoodSignature( false ),
isEncrypted( false ),
isDecryptable( false ),
inProgress( false ),
technicalProblem( false ),
isEncapsulatedRfc822Message( false )
{
@ -55,6 +56,7 @@ namespace KMail {
bool isGoodSignature : 1;
bool isEncrypted : 1;
bool isDecryptable : 1;
bool inProgress : 1;
bool technicalProblem : 1;
bool isEncapsulatedRfc822Message : 1;
};

Loading…
Cancel
Save