From 4ab90edd9f26fcd67e1d0df5dc983ddb7c418e4f Mon Sep 17 00:00:00 2001 From: Carsten Burghardt Date: Sat, 27 Mar 2004 13:26:14 +0000 Subject: [PATCH] Some fixes for the attachment icon. Dedicated to the fearless Cebit fighter Michael Brade ;-) svn path=/trunk/kdepim/; revision=299019 --- kmacctexppop.cpp | 1 + kmacctlocal.cpp | 2 ++ kmcommands.cpp | 5 ++++- kmfolderimap.cpp | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/kmacctexppop.cpp b/kmacctexppop.cpp index 11869d81e..ddde439e2 100644 --- a/kmacctexppop.cpp +++ b/kmacctexppop.cpp @@ -352,6 +352,7 @@ void KMAcctExpPop::slotMsgRetrieved(KIO::Job*, const QString & infoMsg) { if (infoMsg != "message complete") return; KMMessage *msg = new KMMessage; + msg->setComplete(true); // Make sure to use LF as line ending to make the processing easier // when piping through external programs uint newSize = KMFolder::crlf2lf( curMsgData.data(), curMsgData.size() ); diff --git a/kmacctlocal.cpp b/kmacctlocal.cpp index 0cd1f3661..b596d0d69 100644 --- a/kmacctlocal.cpp +++ b/kmacctlocal.cpp @@ -177,6 +177,8 @@ void KMAcctLocal::processNewMail(bool) msg->headerField("X-Status").latin1()); msg->setEncryptionStateChar( msg->headerField( "X-KMail-EncryptionState" ).at(0) ); msg->setSignatureStateChar( msg->headerField( "X-KMail-SignatureState" ).at(0)); + msg->setComplete(true); + msg->updateAttachmentState(); addedOk = processNewMsg(msg); diff --git a/kmcommands.cpp b/kmcommands.cpp index 94af08791..318181132 100644 --- a/kmcommands.cpp +++ b/kmcommands.cpp @@ -1481,9 +1481,12 @@ void KMCopyCommand::execute() list.append(msg); } else { newMsg = new KMMessage; + newMsg->setComplete(msg->isComplete()); + // make sure the attachment state is only calculated when it's complete + if (!newMsg->isComplete()) + newMsg->setReadyToShow(false); newMsg->fromString(msg->asString()); newMsg->setStatus(msg->status()); - newMsg->setComplete(msg->isComplete()); if (srcFolder && !newMsg->isComplete()) { diff --git a/kmfolderimap.cpp b/kmfolderimap.cpp index 94dcfc689..f7e181cd9 100644 --- a/kmfolderimap.cpp +++ b/kmfolderimap.cpp @@ -1026,6 +1026,8 @@ void KMFolderImap::slotGetMessagesData(KIO::Job * job, const QByteArray & data) while (pos >= 0) { KMMessage *msg = new KMMessage; + msg->setComplete(false); + msg->setReadyToShow(false); msg->fromString((*it).cdata.mid(16, pos - 16)); flags = msg->headerField("X-Flags").toInt(); ulong uid = msg->UID();