FolderSettings: Fix "no resource found in collection" assert.
ClosedPublic

Authored by dfaure on Jul 9 2018, 6:35 PM.

Details

Summary

Use collectionFromId on demand when the resource is needed and wasn't
set in the collection passed to FolderSettings::forCollection.
For instance this happens in KMail::Util::mailingListsFromMessage
which uses item.parentCollection(), where the resource isn't set.

We do this on demand rather than in setCollection() because
in many cases (when other methods of FolderSettings are being called)
we don't actually need the resource.

Test Plan

Reply followed by Forward-as-attachment would often hit
the assert for me, especially when using the toolbar buttons (probably
unrelated?).

Diff Detail

Repository
R92 PIM: Common Mail Support
Branch
Applications/18.04
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 712
Build 724: arc lint + arc unit
dfaure created this revision.Jul 9 2018, 6:35 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptJul 9 2018, 6:35 PM
Restricted Application edited subscribers, added: kde-pim; removed: KDE PIM. · View Herald Transcript
dfaure requested review of this revision.Jul 9 2018, 6:35 PM
vkrause accepted this revision.Jul 9 2018, 6:43 PM
This revision is now accepted and ready to land.Jul 9 2018, 6:43 PM
dfaure closed this revision.Jul 9 2018, 6:51 PM