New mail notification: Can show message, but not delete it
ClosedPublic

Authored by marten on Mar 12 2018, 8:51 AM.

Details

Summary

The "New mail arrived" notification (for a single message) has a "Show mail" button. This is useful, but in the message viewer window that appears when this button is clicked the "Move to wastebin" action is disabled, both in the toolbar and "File" menu. This is a pity, because if the message turns out to be junk it would be very useful to be able to delete it immediately without having to open the main KMail window.

The problem appears to be in KMKernel::showMail(), where KMReaderMainWin::showMessage() is called with the third parameter, the item's parent collection, defaulted to none. KMReaderMainWin::showMessage() then disables the delete action because canChange is false if there is no parent collection.

This change fetches the item's parent collection as part of the job, and then passes it to the reader window. The delete action is then enabled and works, allowing an unwanted message to be deleted with just one extra click.

Test Plan

Built kmail with this change. Verified that, in the reader window opened from the notification button, the "Move to wastebin" action is enabled and works.

Diff Detail

Repository
R206 KMail
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
marten created this revision.Mar 12 2018, 8:51 AM
Restricted Application added a project: KDE PIM. · View Herald TranscriptMar 12 2018, 8:51 AM
marten requested review of this revision.Mar 12 2018, 8:51 AM
dvratil accepted this revision.Mar 12 2018, 9:40 AM
This revision is now accepted and ready to land.Mar 12 2018, 9:40 AM
This revision was automatically updated to reflect the committed changes.