Make sure the (local) sent mail folder, where a mail is put as a fallback,

before being moved to an imap sent mail folder, is kept open, otherwise
the KMMsgBase pointers passed to the command become invalid. Introduce
KMCommand::keepFolderOpen( KMFolder* ) which opens a folder and adds it
to the list of folders to be closed by the dtor.

svn path=/trunk/kdepim/; revision=333462
wilder-work
Till Adam 22 years ago
parent 0ad2ee2afb
commit f3c5012371
  1. 6
      kmcommands.cpp
  2. 6
      kmcommands.h
  3. 1
      kmsender.cpp

@ -368,6 +368,12 @@ void KMCommand::slotTransferCancelled()
emit messagesTransfered( Canceled );
}
void KMCommand::keepFolderOpen( KMFolder *folder )
{
folder->open();
mFolders.append( folder );
}
KMMailtoComposeCommand::KMMailtoComposeCommand( const KURL &url,
KMMessage *msg )
:mUrl( url ), mMessage( msg )

@ -47,6 +47,12 @@ public:
KMCommand( QWidget *parent, KMMessage *message );
virtual ~KMCommand();
/** These folders will be closed by the dtor, handy, if you need to keep
a folder open during the lifetime of the command, but don't want to
care about closing it again.
*/
void keepFolderOpen( KMFolder *folder );
/** Returns the result of the command. Only call this method from the slot
connected to completed().
*/

@ -348,6 +348,7 @@ void KMSender::doSendMsg()
if (imapSentFolder) {
// Does proper folder refcounting and message locking
KMCommand *command = new KMMoveCommand( imapSentFolder, mCurrentMsg );
command->keepFolderOpen( sentFolder ); // will open it, and close it once done
command->start();
}
default:

Loading…
Cancel
Save