New ProjectModel implementation

Andreas Pakulat apaku at gmx.de
Sun Jun 27 22:22:54 UTC 2010


On 27.06.10 20:44:07, David Nolden wrote:
> 2010/6/27 Andreas Pakulat <apaku at gmx.de>:
> > Hi,
> >
> > just to let you know, I've just merged the rewrite of the projectmodel
> > API I've worked on into master. Its now indepdenent of any GUI
> > dependencies and doesn't use QStandardItemModel anymore but custom
> > items. This also allowed to minimize the API a bit and make it more
> > specific (a real rename function instead of some hidden way of using
> > setData).
> >
> > I couldn't see any regressions and we do have a quite good unit-test for
> > it too. (it covers around 60% currently IIRC).
> >
> > It'll hopefully also make it easier to change the actual implementation
> > to a ref-counted version or something other. I'm not sure thats really
> > necessary though, it should be enough if places that do store
> > item-pointers also listen to model-signals to find out wether their item
> > is deleted and then remove it from their internal storage.
> 
> That would be very inconvenient, but with some smart-pointer like
> thing which listens to those signals, it should be fine (it should
> just become zero when the item is deleted).

I was more thinking about a "WatchingProjectItemList" or so, that wraps
a QList<ProjectBaseItem*> + doing the signal-listening. Would be quite a
bit simpler to do than full smart-pointer (at least for me) and probably
enough for most/all use-cases.

Andreas

-- 
Artistic ventures highlighted.  Rob a museum.




More information about the KDevelop-devel mailing list