]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Improve performance when turning on the preview mode
authorPeter Penz <peter.penz19@gmail.com>
Sun, 13 Feb 2011 12:19:12 +0000 (13:19 +0100)
committerPeter Penz <peter.penz19@gmail.com>
Sun, 13 Feb 2011 12:23:46 +0000 (13:23 +0100)
If a change from a directory with disabled previews is done to a directory with enabled previews, also previews are generated for the previous directory as the preview-generator still contains the not updated directory lister. Because of this it is important to apply the view-properties after the directory-lister has been updated.

src/views/dolphinview.cpp

index 4ab16e0528a7eb3e4a8ae98c3cc25437c673ad61..db917ee5a3e8b16774d4081bf9cc26017d5637bf 100644 (file)
@@ -434,9 +434,13 @@ void DolphinView::refresh()
     m_active = true;
 
     createView();
     m_active = true;
 
     createView();
-    applyViewProperties();
     reload();
 
     reload();
 
+    // For performance reasons applying the view properties should be done after updating
+    // the directory-lister URL with reload(). Otherwise in combination with enabled
+    // previews the creation of already obsolete directory items gets triggered.
+    applyViewProperties();
+
     setActive(oldActivationState);
     updateZoomLevel(oldZoomLevel);
 }
     setActive(oldActivationState);
     updateZoomLevel(oldZoomLevel);
 }
@@ -544,7 +548,6 @@ void DolphinView::setUrl(const KUrl& url)
 
     m_viewModeController->setUrl(url); // emits urlChanged, which we forward
     m_viewAccessor.prepareUrlChange(url);
 
     m_viewModeController->setUrl(url); // emits urlChanged, which we forward
     m_viewAccessor.prepareUrlChange(url);
-    applyViewProperties();
 
     // When changing the URL there is no need to keep the version
     // data of the previous URL.
 
     // When changing the URL there is no need to keep the version
     // data of the previous URL.
@@ -554,6 +557,11 @@ void DolphinView::setUrl(const KUrl& url)
     connectViewAccessor();
     loadDirectory(url);
 
     connectViewAccessor();
     loadDirectory(url);
 
+    // For performance reasons applying the view properties should be done after updating
+    // the directory-lister URL with loadDirectory(). Otherwise in combination with enabled
+    // previews the creation of already obsolete directory items gets triggered.
+    applyViewProperties();
+
     if (hadSelection || hasSelection()) {
         emitSelectionChangedSignal();
     }
     if (hadSelection || hasSelection()) {
         emitSelectionChangedSignal();
     }