diff --git a/folderstorage.cpp b/folderstorage.cpp index 7ec1334cd..1c88ca3a4 100644 --- a/folderstorage.cpp +++ b/folderstorage.cpp @@ -433,10 +433,10 @@ KMMessage* FolderStorage::getMsg(int idx) msg = readMsg(idx); // sanity check if (mCompactable && (!msg || (msg->subject().isEmpty() != mbSubject.isEmpty()))) { - kdDebug(5006) << "Error: " << location() << - " Index file is inconsistent with folder file. This should never happen." << endl; - mCompactable = FALSE; // Don't compact - writeConfig(); + kdDebug(5006) << "Error: " << location() << + " Index file is inconsistent with folder file. This should never happen." << endl; + mCompactable = FALSE; // Don't compact + writeConfig(); } } @@ -470,14 +470,15 @@ KMMessage* FolderStorage::readTemporaryMsg(int idx) // the caller will delete it, so we must make a copy it msg = new KMMessage(*(KMMessage*)mb); msg->setMsgSerNum(sernum); + msg->setComplete( true ); } else { // ## Those two lines need to be moved to a virtual method for KMFolderSearch, like readMsg msg = new KMMessage(*(KMMsgInfo*)mb); msg->setMsgSerNum(sernum); // before fromDwString so that readyToShow uses the right sernum + msg->setComplete( true ); msg->fromDwString(getDwString(idx)); } msg->setEnableUndo(undo); - msg->setComplete( true ); return msg; } diff --git a/kmfoldermaildir.cpp b/kmfoldermaildir.cpp index f2409ab7d..d708cf8b3 100644 --- a/kmfoldermaildir.cpp +++ b/kmfoldermaildir.cpp @@ -469,6 +469,10 @@ if( fileD0.open( IO_WriteOnly ) ) { } ++mTotalMsgs; + if ( aMsg->attachmentState() == KMMsgAttachmentUnknown && + aMsg->readyToShow() ) + aMsg->updateAttachmentState(); + // store information about the position in the folder file in the message aMsg->setParent(folder()); aMsg->setMsgSize(size); @@ -545,6 +549,7 @@ KMMessage* KMFolderMaildir::readMsg(int idx) KMMsgInfo* mi = (KMMsgInfo*)mMsgList[idx]; KMMessage *msg = new KMMessage(*mi); // note that mi is deleted by the line below mMsgList.set(idx,&msg->toMsgBase()); // done now so that the serial number can be computed + msg->setComplete( true ); msg->fromDwString(getDwString(idx)); return msg; } diff --git a/kmfoldermbox.cpp b/kmfoldermbox.cpp index 83b4be568..2d40364bf 100644 --- a/kmfoldermbox.cpp +++ b/kmfoldermbox.cpp @@ -1078,6 +1078,10 @@ if( fileD1.open( IO_WriteOnly ) ) { } ++mTotalMsgs; + if ( aMsg->attachmentState() == KMMsgAttachmentUnknown && + aMsg->readyToShow() ) + aMsg->updateAttachmentState(); + // store information about the position in the folder file in the message aMsg->setParent(folder()); aMsg->setFolderOffset(offs);