[Kde-pim] Akonadi EntityTreeModel Fetch Strategies and Invariants

Christian Mollekopf chrigi_1 at fastmail.fm
Tue Nov 8 11:42:37 GMT 2011



On Tuesday, November 08, 2011 4:27 AM, "David Narvaez"
<david.narvaez at computer.org> wrote:
> On Wed, Oct 19, 2011 at 9:16 PM, David Narvaez
> <david.narvaez at computer.org> wrote:
> > On Wed, Oct 19, 2011 at 7:46 PM, Christian Mollekopf
> > > If you need an InvisibleCollectionFetch I suggest working around the issue
> > > using a KDesendandsProxy to flatten the tree and then a MimeTypeFilterProxy to
> > > filter the collections. That works for me without problems.
> >
> > I'm not working on new development: Plasma's Calendar tree model
> > configures the ETM with InvisibleCollectionFetch and everything's
> > breaking badly because of the scenario described on my first e-mail.
> > If your tree already fixes those issues, then we can help Stephen
> > focus on integrating your changes only, so I'll do my best to try it
> > out ASAP before he gets back to work on  this again.
> 
> Hi Christian,
> 
> I tried to use your tree a couple of weeks ago but I found it
> impossible to merge those changes to master in a reasonable amount of
> time. Haven't tried that again lately, but I was thinking I'll try to
> implement the Proxy-based workaround in the Plasma Calendar
> Dataengine. Yet, I can't seem to find the DescendantEntitiesProxyModel
> after API 4.3[0], and  I read a post from Sthephen[1] where he mentions
> he wanted to replace it with the KReparentingProxyModel[2], which is
> also able to flatten collectios, AFAIU. Should I be using that one
> instead? Is there anything wrong with using something from
> akonadi_next in Plasma?
> 
Hey David,

akonadi_next is just some unstable stuff, which is not part of the
official api, and therefore might change at any time and is probably not
yet ready for consumption.
[0] is the class you're looking for together with
EntityMimeTypeFilterModel like this:

KDescendantsProxyModel *desc = new KDescendantsProxyModel(this);
desc->setSourceModel(entitytreemodel);
Akonadi::EntityMimeTypeFilterModel *collectionsModel = new
Akonadi::EntityMimeTypeFilterModel(this);
collectionsModel->addMimeTypeExclusionFilter(
Akonadi::Collection::mimeType() );
collectionsModel->setSourceModel(desc);

I haven't had a look at KReparentingProxyModel but the last time I look
at it, it was far from being production ready.
The implementation didn't handle any updates back then and simply reset
the whole model when anything changed (which i.e. resets the selection).
So unless Stephen fixed it, it's not yet an option.

Regarding my patches: I can imagine that they're pretty outdated by now
(once again). That's why I'm saying, Stephen has to follow this up
eventually, and until then you're better of with the above workaround.

Cheers,
Christian

[0]http://api.kde.org/4.x-api/kdelibs-apidocs/kdeui/html/classKDescendantsProxyModel.html

> David E. Narváez
> 
> [0]
> http://api.kde.org/4.3-api/kdepim-apidocs/akonadi/akonadi_next/html/classAkonadi_1_1DescendantEntitiesProxyModel.html
> [1]
> http://groups.google.com/group/qt-mailing-lists-qt-interest/msg/2b6fd18449670f95
> [2]
> http://api.kde.org/4.x-api/kdepim-apidocs/akonadi_next/html/classKReparentingProxyModel.html
> 
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list