/***************************************************************************
- * Copyright (C) 2009 by Peter Penz <peter.penz@gmx.at> *
+ * Copyright (C) 2009 by Peter Penz <peter.penz19@gmail.com> *
* *
* 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 *
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);
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;
void ViewExtensionsFactory::slotZoomLevelChanged()
{
m_previewGenerator->updateIcons();
- if (m_selectionManager != 0) {
+ if (m_selectionManager) {
m_selectionManager->reset();
}
}