kmail: fix 251009 bug. Send mail doesn't stored in the default send-mail folder if the custom one doesn't exist

Review Request #100269 - Created Dec. 30, 2010 and submitted

Information
Antonis Tsiapaliokas
kdepim
trunk
251009
Reviewers
kdepim
Hello

If you tried to send an email but the custom send-mail folder (settings->configure kmail->identities->modify->advanced) doesn't exist then the kmail doesn't store the send-mail into the default... So with this patch the send-mail is saved in the custom folder (if it exists) otherwise it is saved in the default one...
The kmail compiles fine and kmail works without any issue
Till Adam
Thomas McGuire
Antonis Tsiapaliokas
Thomas McGuire
Antonis Tsiapaliokas
Review request changed

Change Summary:

Hello

I have found out what it cause the bug. In the kdepim/messagecomposer/composerbaseview.cpp the m_fccCombo object is using the currentcollection() method, which it returns a random collection, when the collection which is supposed to return, doesn't exist... So i create a patch which solves this issue. With my patch, if the custom sent-mail collection doesn't exist, then the mail is saved in the default sent-mail collection. If the custom sent-mail collection exists, then the mail is saved there. Messagecomposer and kmail compile without any issue...

Diff:

Revision 3 (+11)

Show changes

Thomas McGuire
Thanks for the patch again.
There are still some holes in it: If the user deletes the folder while the composer is open, the bug is still triggered. Also, when the user queues the message in the outbox and sends it later, there is still a window of opportunity for the folder to get deleted.

So while the patch works, the changes should really be in the maildispatcher agent, as there is no possible race condition for the folder to get deleted in the meantime.
Commit Hook
This review has been submitted with commit 1189d5b3a487c1d68903786f90b94b2c773a4896 by Antonis Tsiapaliokas.
Thomas McGuire
Ok, I have committed this in http://commits.kde.org/kdepim/1189d5b3a487c1d68903786f90b94b2c773a4896, thanks for the patch.
I've changed the function name a bit, added the "const" keyword in two positions. Additionally, the code would crash in slotCollectionFccExists() if m_fccCombo was 0, fixed that as well.

Please close this review request now, as "submitted".
As said in the email to you, the next step would be to add a similar check to the MDA, to fix the case that the collection can be deleted while the message is queued.
Commit Hook
This review has been submitted with commit 044c3af407d68667b123685279581072267305b9 by Thomas McGuire.
Loading...