[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/konqueror/iconview
From:       Enrico Ros <rosenric () dei ! unipd ! it>
Date:       2004-04-05 15:21:11
Message-ID: 20040405152111.9F89A9A05 () office ! kde ! org
[Download RAW message or body]

CVS commit by eros: 

Removing viewport blanking when changing URL.
This saves 2 background-only repaints on the viewport when browsing. It
gaves the feeling of a 'continous' navigation when passing from a
directory to another.


  M +27 -1     konq_iconview.cc   1.458


--- kdebase/konqueror/iconview/konq_iconview.cc  #1.457:1.458
@@ -782,8 +782,24 @@ void KonqKfmIconView::slotCanceled( cons
         m_bLoading = false;
     }
+
+    // See slotCompleted(). If a listing gets canceled, it doesn't emit
+    // the completed() signal, so handle that case.
+    if ( !m_pIconView->viewport()->isUpdatesEnabled() )
+    {
+        m_pIconView->viewport()->setUpdatesEnabled( true );
+        m_pIconView->viewport()->repaint();
+    }
 }
 
 void KonqKfmIconView::slotCompleted()
 {
+    // If updates to the viewport are still blocked (so slotNewItems() has
+    // not been called), a viewport repaint is forced.
+    if ( !m_pIconView->viewport()->isUpdatesEnabled() )
+    {
+        m_pIconView->viewport()->setUpdatesEnabled( true );
+        m_pIconView->viewport()->repaint();
+    }
+
     // Root item ? Store root item in konqiconviewwidget (whether 0L or not)
     m_pIconView->setRootItem( m_dirLister->rootItem() );
@@ -867,4 +883,8 @@ void KonqKfmIconView::slotNewItems( cons
     // After filtering out updates-on-insertions we can re-enable updates
     m_pIconView->setUpdatesEnabled( true );
+    // Locking the viewport has filtered out blanking and now, since we
+    // have some items to draw, we can restore updating.
+    if ( !m_pIconView->viewport()->isUpdatesEnabled() )
+        m_pIconView->viewport()->setUpdatesEnabled( true );
     KonqDirPart::newItems( entries );
 }
@@ -992,6 +1012,12 @@ void KonqKfmIconView::slotClear()
 {
     resetCount();
-    m_pIconView->clear();
 
+    // We're now going to update the view with new contents. To avoid
+    // meaningless paint operations we disable updating the viewport from now
+    // to the time we'll receive some new data (or in slotComplete in case of
+    // no new data).
+    m_pIconView->viewport()->setUpdatesEnabled( false );
+
+    m_pIconView->clear();
     // If directory properties are changed, apply pending changes
     // changes are: view background or color, iconsize, enabled previews


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic