X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/8eb9b508ca87fb1d634d8b8ba62c054ed04466d2..14bae32f371663d172e1dd39d98080fd8695d991:/src/views/viewextensionsfactory.cpp diff --git a/src/views/viewextensionsfactory.cpp b/src/views/viewextensionsfactory.cpp index f89a0cb85..a52871ff4 100644 --- a/src/views/viewextensionsfactory.cpp +++ b/src/views/viewextensionsfactory.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009 by Peter Penz * + * Copyright (C) 2009 by Peter Penz * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -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); @@ -155,7 +161,7 @@ bool ViewExtensionsFactory::autoFolderExpandingEnabled() const bool ViewExtensionsFactory::eventFilter(QObject* watched, QEvent* event) { Q_UNUSED(watched); - if ((event->type() == QEvent::Wheel) && (m_selectionManager != 0)) { + if ((event->type() == QEvent::Wheel) && m_selectionManager) { m_selectionManager->reset(); } return false; @@ -164,7 +170,7 @@ bool ViewExtensionsFactory::eventFilter(QObject* watched, QEvent* event) void ViewExtensionsFactory::slotZoomLevelChanged() { m_previewGenerator->updateIcons(); - if (m_selectionManager != 0) { + if (m_selectionManager) { m_selectionManager->reset(); } }