[PATCH/RFC] On the iconview and the speed of directory listing.

David Faure dfaure at klaralvdalens-datakonsult.se
Tue May 27 00:12:55 CEST 2003


On Monday 26 May 2003 15:53, Maks Orlovich wrote:
> On Monday 26 May 2003 04:55 am, David Faure wrote:
> > On Monday 26 May 2003 02:04, Maks Orlovich wrote:
> > > > Oh, then what about calcRect first (but on the KIconViewItem), then
> > > > insertItem? Or does your updateItemContainer speedup mean that this
> > > > isn't necessary anymore?
> > >
> > > Yes, that works, and no, it still makes a difference, although not as
> > > dramatic - it makes slotNewItems go from 6.7 or so seconds to 3.5 or so
> > > seconds, as far as I can see (measurements are kind of noisy). The
> > > difficulty is in doing this cleanly, as we need to pass a view pointer to
> > > the calculations code currently in calcRect(), and in that  KIconViewItem
> > > ctors are all inline, so it can't do it itself.  (Unless some brave soul
> > > can come up with a way to safely work with the old inline versions --
> > > hmm, perhaps checking the iconView() for being non-null will detect the
> > > old inline ctors being used? -- worth trying, I guess).
> >
> > Another solution would be a factory method:
> > add a
> > KIconViewItem* KIconView::newIconViewItem(...)  (or createIconViewItem?)
> > which does what we want (new with 0 as parent, then calcRect, then
> > insertItem).
> 
> That sounds nice, but I don't see ATM how can this be made to work nicely 
> with inheritance? After all, KFileIVI is the case that matters for Konq..

You're right :(
The only solution is to duplicate the code in KonqIconViewWidget. Not nice.

-- 
David Faure -- faure at kde.org, dfaure at klaralvdalens-datakonsult.se
Qt/KDE/KOffice developer
Klarälvdalens Datakonsult AB, Platform-independent software solutions


More information about the Kde-optimize mailing list