diff options
Diffstat (limited to 'src/views')
| -rw-r--r-- | src/views/dolphinview.cpp | 12 | ||||
| -rw-r--r-- | src/views/viewextensionsfactory.cpp | 8 |
2 files changed, 9 insertions, 11 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index db917ee5a..4ab16e052 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -434,12 +434,8 @@ void DolphinView::refresh() m_active = true; createView(); - 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(); + reload(); setActive(oldActivationState); updateZoomLevel(oldZoomLevel); @@ -548,6 +544,7 @@ void DolphinView::setUrl(const KUrl& 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. @@ -557,11 +554,6 @@ void DolphinView::setUrl(const KUrl& 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(); } diff --git a/src/views/viewextensionsfactory.cpp b/src/views/viewextensionsfactory.cpp index 1a395dea9..a52871ff4 100644 --- a/src/views/viewextensionsfactory.cpp +++ b/src/views/viewextensionsfactory.cpp @@ -73,8 +73,14 @@ ViewExtensionsFactory::ViewExtensionsFactory(QAbstractItemView* view, this, SLOT(slotZoomLevelChanged())); connect(viewModeController, SIGNAL(cancelPreviews()), this, SLOT(cancelPreviews())); + + // slotPreviewChanged() is connected as Qt::QueuedConnection to prevent performance + // issues when the directory lister changes its URL after the preview-changes have + // been applied. Usecase: Switch from directory A having no previews to + // directory B with previews (see sequence in DolphinView::setUrl()). connect(dolphinViewController->view(), SIGNAL(showPreviewChanged()), - this, SLOT(slotShowPreviewChanged())); + this, SLOT(slotShowPreviewChanged()), + Qt::QueuedConnection); // initialize selection manager m_selectionManager = new SelectionManager(view); |
