Review Request: Drop InvisibleCollectionFetch Fetch Strategy in Favor of KDescendantsProxyModel

Christian Mollekopf chrigi_1 at fastmail.fm
Sat Nov 19 17:04:38 UTC 2011



> On Nov. 19, 2011, 3:50 p.m., Christian Mollekopf wrote:
> > You might want to filter the collections out using: 
> > 
> > > Akonadi::EntityMimeTypeFilterModel *collectionsModel = new konadi::EntityMimeTypeFilterModel(this);
> > > collectionsModel->addMimeTypeExclusionFilter( Akonadi::Collection::mimeType() );
> > 
> > Otherwise you have the model flattened, with the collections still in.
> > No idea if it is relevant for this case, but with the EntityMimeTypeFilterModel you would get exactly the same result as an invisible collection fetch.
> 
> David Narváez wrote:
>     I thought of adding the filter, but then I noticed that in this case the KDescendantsProxyFilter is flattening a CalendarModel which is, in turn, constructed from a Monitor which is a mime-filtered model itself (see the first context lines of the relevant hunk, which are dealing with the monitor before using it in the calendar). Is that enough for a mime filter as you describe it?

I assume your referring to the setMimeTypeMonitored calls on the monitor. This means the monitor is configured to only include items of the configured mimetypes, however they're still in the collection hierarchy. So collections are not mimetype checked (since they're only the containers). Therefore you should still have the collections in the flattened model.
So filtering the collections afterwards seems cleaner to me, although the Calendar might work just fine with empty collections in the list.


- Christian


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/103088/#review8314
-----------------------------------------------------------


On Nov. 10, 2011, 6:12 a.m., David Narváez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/103088/
> -----------------------------------------------------------
> 
> (Updated Nov. 10, 2011, 6:12 a.m.)
> 
> 
> Review request for Plasma and Christian Mollekopf.
> 
> 
> Description
> -------
> 
> As the InvisibleCollectionFetch fetch strategy is currently broken, I implemented a suggestion by Christian Mollekopf of working around the issues by flatting the model through a KDescendantsProxyModel to fix crashes in Plasma related to calendars.
> 
> 
> This addresses bug 279322.
>     http://bugs.kde.org/show_bug.cgi?id=279322
> 
> 
> Diffs
> -----
> 
>   plasma/generic/dataengines/calendar/calendarengine.cpp 53f98c0 
> 
> Diff: http://git.reviewboard.kde.org/r/103088/diff/diff
> 
> 
> Testing
> -------
> 
> 1. Add an iCal resource from the internet
> 2. Refresh the iCal resource
> 3. Refresh the iCal resource again if Plasma didn't crash on step 2
> 
> Withouth this patch, Plasma crashes when trying to remove an item that has no collection in the Calendar Model embedded in the Dataengine.
> 
> You should also be able to replicate bug 279322 without this patch and this patch should fix the situation described there.
> 
> 
> Thanks,
> 
> David Narváez
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20111119/1acbd088/attachment-0001.html>


More information about the Plasma-devel mailing list