KFileInfo: using shared data
faure at kde.org
Fri Apr 14 17:23:07 BST 2006
On Fri, Apr 14, 2006 at 06:17:44PM +0200, Thiago Macieira wrote:
> Hamish Rodda wrote:
> >I was looking at KFileInfo and noticed that it was marked as "/// KDE4
> > TODO: make them refcounted, e.g. using QSharedMimeData."
> >So, I started out porting it over to be implicitly shared using
> > QSharedData. Went pretty easily, for the most part.
> >However, changing from pointers shared copies doesn't work well, because
> > when a change is made it means that all of the other instances don't
> > get the change.
> >Is the plan to make this class explicitly shared?
> QSharedMimeData is supposed to be about implicitly sharing.
Yes. But I didn't really think this through when adding the TODO.
I think using KSharedPtr would be better, in fact, since this is about
refcounting the file items, not about making changes to them without
affecting other copies.
More information about the kde-core-devel