Fix dropping of emails onto favorites
ClosedPublic

Authored by dfaure on Dec 18 2017, 11:09 PM.

Details

Summary

and dropping a collection to define a new favorite.

BUG: 387873

Test Plan

Tested all three features, reordering, adding, and dropping a mail.

Two issues left:

  • adding a new favourite at a specific position (patch pending for akonadi's favoritecollectionsmodel)
  • the "+" when moving to reorder shouldn't appear, should be MoveAction only, don't know if that's possible here though.

Diff Detail

Repository
R92 PIM: Common Mail Support
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
dfaure created this revision.Dec 18 2017, 11:09 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptDec 18 2017, 11:09 PM
dfaure requested review of this revision.Dec 18 2017, 11:09 PM

Tested it and dropping now works. Thanks!
The reordering however does not work very well. When having 3 items (icon mode) and I move one I can end up having it placed anywhere (e.g. lower than the 2 others)
or when trying to reorder the icons from "1 2 3" to "3 1 2" I can not get the 3 to the most left position as there is no space before the first one and also inserting
an item between two others is the same problem.

Yes, QListView in icon mode doesn't support reordering, I don't think there's anything I can do about that. AFAICS it only supports "free form spatial positioning" (like in file managers, with or without snapping to grid, QListView::Free/QListView::Snap) or no movement at all (QListView::Static). The reordering feature I implemented only works for QListView in list mode. I'm disappointed about that too.

dvratil accepted this revision.Dec 19 2017, 8:58 PM
This revision is now accepted and ready to land.Dec 19 2017, 8:58 PM
dfaure closed this revision.Dec 19 2017, 10:11 PM

Broke the unit test introduced before in D8884 though, the part which does

QVERIFY((orderProxy->flags(firstRowIndex) & Qt::ItemIsDropEnabled) == 0);

in FavoriteProxyTest::testReordering()

>3 years and no-one fixed it? Oh dear :) Complaining here to raise awareness, preparing a patch right now myself.

dfaure added a comment.Aug 9 2021, 2:34 PM

Thanks. Nobody told me it broke a unittest and I didn't notice, indeed. I think kdepim's unittests are ... lacking supervision.