]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/viewextensionsfactory.cpp
Show icon overlays in the Informationen Panel.
[dolphin.git] / src / views / viewextensionsfactory.cpp
index f89a0cb858954b11bf4936781d4fced5e8a5719c..a52871ff447afe1d62c2a1cdc10eed9a51bc82dc 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   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  *
@@ -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();
     }
 }