[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-07-18 13:15:25
Message-ID: 20040718131525.DE3219A5C () office ! kde ! org
[Download RAW message or body]

CVS commit by eros: 

Fixed view->preview actions checking (it was a bad assumption of mine on
multithreaded code). Fixed previews stopping when changing IV mode.
CCMAIL: 76052-done@bugs.kde.org


  M +13 -6     konq_iconview.cc   1.470
  M +7 -0      konq_iconview.h   1.171


--- kdebase/konqueror/iconview/konq_iconview.cc  #1.469:1.470
@@ -386,4 +386,5 @@ KonqKfmIconView::KonqKfmIconView( QWidge
     m_bUpdateContentsPosAfterListing = false;
     m_bDirPropertiesChanged = true;
+    m_bPreviewRunningBeforeCloseURL = false;
     m_pIconView->setResizeMode( QIconView::Adjust );
 
@@ -694,4 +695,5 @@ bool KonqKfmIconView::doCloseURL()
     m_mimeTypeResolver->m_lstPendingMimeIconItems.clear();
 
+    m_bPreviewRunningBeforeCloseURL = m_pIconView->isPreviewRunning();
     m_pIconView->stopImagePreview();
     return true;
@@ -992,8 +994,7 @@ void KonqKfmIconView::slotNewItems( cons
 void KonqKfmIconView::slotDeleteItem( KFileItem * _fileitem )
 {
-    m_pIconView->stopImagePreview();
-
     if ( _fileitem == m_dirLister->rootItem() )
     {
+        m_pIconView->stopImagePreview();
         m_pIconView->setRootItem( 0L );
         return;
@@ -1009,4 +1010,5 @@ void KonqKfmIconView::slotDeleteItem( KF
     if (ivi)
     {
+        m_pIconView->stopImagePreview();
         KonqDirPart::deleteItem( _fileitem );
 
@@ -1132,5 +1134,4 @@ void KonqKfmIconView::slotClear()
     if ( m_bDirPropertiesChanged )
     {
-        m_bDirPropertiesChanged = false;
         m_pProps->applyColors( m_pIconView->viewport() );
         newIconSize( m_pProps->iconSize() );
@@ -1262,7 +1263,6 @@ bool KonqKfmIconView::doOpenURL( const K
     m_dirLister->openURL( url, false, args.reload );
 
-    // Properties (icon size, preview, ..) will be applied into the
-    // slotClear(); this is called between m_dirLister->openURL and the
-    // first incoming results that will be delivered with slotNewItems
+    // View properties (icon size, background, ..) will be applied into slotClear()
+    // if m_bDirPropertiesChanged is set. If so, here we update preview actions.
     if ( m_bDirPropertiesChanged )
     {
@@ -1331,4 +1331,11 @@ void KonqKfmIconView::setViewMode( const
         m_pIconView->setItemTextPos(QIconView::Bottom);
     }
+
+    if ( m_bPreviewRunningBeforeCloseURL )
+    {
+        m_bPreviewRunningBeforeCloseURL = false;
+        // continue (param: false) a preview job interrupted by doCloseURL
+        m_pIconView->startImagePreview( m_pProps->previewSettings(), false );
+    }
 }
 

--- kdebase/konqueror/iconview/konq_iconview.h  #1.170:1.171
@@ -179,4 +179,11 @@ protected:
   bool m_bDirPropertiesChanged:1;
 
+  /**
+   * Set in doCloseURL and used in setViewMode to restart a preview
+   * job interrupted when switching to IconView or MultiColumnView.
+   * Hacks like this must be removed in KDE4!
+   */
+  bool m_bPreviewRunningBeforeCloseURL:1;
+
   bool m_bNeedSetCurrentItem:1;
   


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

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