Fix handling of cut collections.

Authored by dfaure on Apr 18 2018, 7:26 AM.

Description

Fix handling of cut collections.

Summary:
For many years I would randomly see one of my email folders become
unselectable, often my inbox, for no apparent reason. And if it was
actually selected when this happened, then switching to another folder
would select both (not being able to unselect the now-unselectable one),
showing the merged view in the messagelist.
Only apparent solution was a kmail restart.
I finally found what triggered all this: Ctrl+X !
Cut collections were marked as selectable, but not enabled, which
effectively made them unselectable.

New solution: leaving flags untouched in the model, and simply changing
the text color in the delegate, for cut collections.
This makes cut collections still fully work, just like you can fully
interact with cut files in a file manager.

I wonder if we want to do the same with cut items, but I'm not sure where
the delegate(s) are, and how to catch them all. The risk of accidentally
cutting is much lower with items anyway (Ctrl+Alt+X).
Also, this code came from the fix for bug 213466, which was about items
in the first place (not collections).

Test Plan: click on email folder, Ctrl+X. Try it, it's fun.

Reviewers: mlaurent, dvratil

Reviewed By: dvratil

Subscribers: KDE PIM

Tags: KDE PIM

Differential Revision: https://phabricator.kde.org/D12303

Details

Committed
dfaureApr 20 2018, 7:52 AM
Reviewer
dvratil
Differential Revision
D12303: Fix handling of cut collections.
Parents
R165:384e3bf2bb29: GIT_SILENT: prepare 5.8.1
Branches
Unknown
Tags
Unknown