Commit 6577a4db authored by Peter Penz's avatar Peter Penz
Browse files

Fix issue that wrong directory is shown

Commit 680009b5 resulted in a regression when switching from a view in the column-mode to a view in the icon- or details-mode: The wrong content has been shown. This patch reverts commit 680009b5 and solves the performance-issue in combination with previews by triggering the preview-generation in a queued way.
parent a60b1b6e
...@@ -430,12 +430,8 @@ void DolphinView::refresh() ...@@ -430,12 +430,8 @@ void DolphinView::refresh()
m_active = true; m_active = true;
createView(); 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(); applyViewProperties();
reload();
setActive(oldActivationState); setActive(oldActivationState);
updateZoomLevel(oldZoomLevel); updateZoomLevel(oldZoomLevel);
...@@ -539,6 +535,7 @@ void DolphinView::setUrl(const KUrl& url) ...@@ -539,6 +535,7 @@ void DolphinView::setUrl(const KUrl& url)
m_viewModeController->setUrl(url); // emits urlChanged, which we forward m_viewModeController->setUrl(url); // emits urlChanged, which we forward
m_viewAccessor.prepareUrlChange(url); m_viewAccessor.prepareUrlChange(url);
applyViewProperties();
// When changing the URL there is no need to keep the version // When changing the URL there is no need to keep the version
// data of the previous URL. // data of the previous URL.
...@@ -548,11 +545,6 @@ void DolphinView::setUrl(const KUrl& url) ...@@ -548,11 +545,6 @@ void DolphinView::setUrl(const KUrl& url)
connectViewAccessor(); connectViewAccessor();
loadDirectory(url); 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()) { if (hadSelection || hasSelection()) {
emitSelectionChangedSignal(); emitSelectionChangedSignal();
} }
......
...@@ -73,8 +73,14 @@ ViewExtensionsFactory::ViewExtensionsFactory(QAbstractItemView* view, ...@@ -73,8 +73,14 @@ ViewExtensionsFactory::ViewExtensionsFactory(QAbstractItemView* view,
this, SLOT(slotZoomLevelChanged())); this, SLOT(slotZoomLevelChanged()));
connect(viewModeController, SIGNAL(cancelPreviews()), connect(viewModeController, SIGNAL(cancelPreviews()),
this, SLOT(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()), connect(dolphinViewController->view(), SIGNAL(showPreviewChanged()),
this, SLOT(slotShowPreviewChanged())); this, SLOT(slotShowPreviewChanged()),
Qt::QueuedConnection);
// initialize selection manager // initialize selection manager
m_selectionManager = new SelectionManager(view); m_selectionManager = new SelectionManager(view);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment