[PATCH] Speed up iconView's setIcons 2x...

David Faure david at mandrakesoft.com
Wed Aug 28 12:05:35 BST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 26 August 2002 17:41, Koos Vriezen wrote:
> Actually this is a quite trivial fix, m_pIconView->setIcons already does a
> arrangeItemsInGrid in libkonq/konq_iconviewwidget.cc:822:
> 
>   if ( autoArrange() && (oldGridX != gridX() || !stopImagePreviewFor.isEmpty())
>         arrangeItemsInGrid( false ); // take new grid into account
> 
>     update(); //Repaint later..
> 
> So what you say is already done.

Oh, ok, cool. No objections to this patch begin applied then.

> The patch above handles going back and forward in history. There are still
> other cases which show the same problem (icons first drawn unsorted and
> a few msec later drawn sorted). Eg. after previewing a document and
> pressing the back button.
> Some traces of that case which I did yesterday:
>   #0  0x40b12695 in QIconView::arrangeItemsInGrid ()
>   #1  0x40b166bd in QIconView::adjustItems ()
>   #2  0x40b16659 in QIconView::resizeEvent ()
>   #3  0x409e5c25 in QWidget::event ()
>   #9  0x40a8eaa6 in QScrollView::show ()
>   #10 0x4008e7c8 in KonqFrame::attachInternal ()
>   #11 0x4008e67c in KonqFrame::attach ()
> 
>   #0  0x40b12695 in QIconView::arrangeItemsInGrid ()
>   #1  0x40b166bd in QIconView::adjustItems ()
>   #2  0x40b16659 in QIconView::resizeEvent ()
>   #10 0x409a65ee in QBoxLayout::setGeometry ()
>   #11 0x4096a78e in QLayout::activate ()
>   #12 0x4008e803 in KonqFrame::attachInternal ()
>   #13 0x4008e67c in KonqFrame::attach ()
> Next icons are added to the iconview

So the above calls didn't have any icons to rearrange, right?
(so this isn't the problem).

>   #0  0x4125464d in KonqKfmIconView::newIconSize ()
>   #1  0x41256552 in KonqKfmIconView::doOpenURL ()
>   #2  0x4010c0e0 in KonqDirPart::openURL ()
>   #3  0x40155fae in KParts::BrowserExtension::restoreState ()
>   #4  0x41258f3c in IconViewBrowserExtension::restoreState ()
>   #5  0x4007c2c4 in KonqView::go ()
> Next update event occurs. This is not the update from
> libkonq/konq_iconviewwidget.cc:822. Commenting it out, doesn't improve it.
>   #0  0x40b12695 in QIconView::arrangeItemsInGrid ()
>   #1  0x40b1a3fc in QIconView::sizeHint ()

Hmm, ok, the first sizeHint needs to arrange the icons - but it doesn't repaint,
so that should be ok I think.

> <icons are painted unsorted two times>

> Next timer event for updating (slotUpdate) and sorting occurs
>   #0  0x40b12695 in QIconView::arrangeItemsInGrid ()
>   #1  0x40b1a2f0 in QIconView::sort ()
>   #2  0x40b10b24 in QIconView::slotUpdate ()
>   #8  0x40c20b29 in QTimer::timeout ()
>   #9  0x409d4bbf in QTimer::event ()

Well, if the sorting happens after a QTimer, then obviously that's the problem
(it paints immediately, but sorts after the timer, and repaints then). Sounds like
a QIconView bug/misbehaving to me... Either it should sort immediately,
or maybe it could prevent repaints before the sorting has been done.

- -- 
David FAURE, david at mandrakesoft.com, faure at kde.org
http://people.mandrakesoft.com/~david/
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
KOffice-1.2-rc1 is out. ftp://ftp.kde.org/pub/kde/unstable/koffice-1.2-rc1/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9bK5/72KcVAmwbhARAhWAAJ0XyLMJt4RVVlr0trQW2zTT4NP5cgCbBDUG
xlWKlgDizePVxfniZjKelDs=
=tHqB
-----END PGP SIGNATURE-----





More information about the kfm-devel mailing list