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

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

Description

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

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?).

Reviewers: mlaurent, dvratil, vkrause

Reviewed By: vkrause

Subscribers: kde-pim

Tags: KDE PIM

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

Details

Committed
dfaureJul 9 2018, 6:51 PM
Reviewer
vkrause
Differential Revision
D14010: FolderSettings: Fix "no resource found in collection" assert.
Parents
R92:e8555aac434c: GIT_SILENT: Prepare 5.8.3
Branches
Unknown
Tags
Unknown
References
tag: v18.04.3, Applications/18.04