]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphindetailsview.cpp
- The selection changed timer only needs to be created for a DolphinView instance.
[dolphin.git] / src / dolphindetailsview.cpp
index 83bc7cdd348036bd07edb590b514b0c8766fb030..f0671db55259b4a52bc1c61c7542a9801c604b44 100644 (file)
@@ -27,7 +27,6 @@
 #include "dolphinsortfilterproxymodel.h"
 #include "dolphinviewautoscroller.h"
 #include "draganddrophelper.h"
-#include "selectionmanager.h"
 #include "viewextensionsfactory.h"
 #include "viewproperties.h"
 #include "zoomlevelinfo.h"
@@ -56,8 +55,7 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent,
     m_useDefaultIndexAt(true),
     m_ignoreScrollTo(false),
     m_controller(controller),
-    m_selectionManager(0),
-    m_autoScroller(0),
+    m_extensionsFactory(0),
     m_expandableFoldersAction(0),
     m_font(),
     m_decorationSize(),
@@ -81,7 +79,6 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent,
     setModel(proxyModel);
 
     setMouseTracking(true);
-    m_autoScroller = new DolphinViewAutoScroller(this);
 
     const ViewProperties props(controller->url());
     setSortIndicatorSection(props.sorting());
@@ -113,20 +110,10 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent,
                 controller, SLOT(triggerItem(const QModelIndex&)));
     }
 
-    if (DolphinSettings::instance().generalSettings()->showSelectionToggle()) {
-        m_selectionManager = new SelectionManager(this);
-        connect(m_selectionManager, SIGNAL(selectionChanged()),
-                this, SLOT(requestActivation()));
-        connect(m_controller, SIGNAL(urlChanged(const KUrl&)),
-                m_selectionManager, SLOT(reset()));
-    }
-
     connect(this, SIGNAL(entered(const QModelIndex&)),
             this, SLOT(slotEntered(const QModelIndex&)));
     connect(this, SIGNAL(viewportEntered()),
             controller, SLOT(emitViewportEntered()));
-    connect(controller, SIGNAL(nameFilterChanged(const QString&)),
-            this, SLOT(setNameFilter(const QString&)));
     connect(controller, SIGNAL(zoomLevelChanged(int)),
             this, SLOT(setZoomLevel(int)));
     connect(controller->dolphinView(), SIGNAL(additionalInfoChanged()),
@@ -150,7 +137,6 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent,
     connect(view, SIGNAL(showPreviewChanged()),
             this, SLOT(slotShowPreviewChanged()));
 
-    updateDecorationSize(view->showPreview());
 
     setFocus();
     viewport()->installEventFilter(this);
@@ -165,7 +151,10 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent,
     connect(m_expandableFoldersAction, SIGNAL(toggled(bool)),
             this, SLOT(setFoldersExpandable(bool)));
 
-    new ViewExtensionsFactory(this, controller);
+    m_extensionsFactory = new ViewExtensionsFactory(this, controller);
+    m_extensionsFactory->fileItemDelegate()->setMinimizedNameColumn(true);
+
+    updateDecorationSize(view->showPreview());
 }
 
 DolphinDetailsView::~DolphinDetailsView()
@@ -411,10 +400,6 @@ void DolphinDetailsView::resizeEvent(QResizeEvent* event)
 
 void DolphinDetailsView::wheelEvent(QWheelEvent* event)
 {
-    if (m_selectionManager != 0) {
-        m_selectionManager->reset();
-    }
-
     // let Ctrl+wheel events propagate to the DolphinView for icon zooming
     if (event->modifiers() & Qt::ControlModifier) {
         event->ignore();
@@ -430,7 +415,7 @@ void DolphinDetailsView::wheelEvent(QWheelEvent* event)
 void DolphinDetailsView::currentChanged(const QModelIndex& current, const QModelIndex& previous)
 {
     QTreeView::currentChanged(current, previous);
-    m_autoScroller->handleCurrentIndexChange(current, previous);
+    m_extensionsFactory->handleCurrentIndexChange(current, previous);
 
     // Stay consistent with QListView: When changing the current index by key presses,
     // also change the selection.
@@ -538,12 +523,6 @@ QRect DolphinDetailsView::elasticBandRect() const
     return QRect(topLeft, bottomRight).normalized();
 }
 
-void DolphinDetailsView::setNameFilter(const QString& nameFilter)
-{
-    DolphinSortFilterProxyModel* proxyModel = static_cast<DolphinSortFilterProxyModel*>(model());
-    proxyModel->setFilterRegExp(nameFilter);
-}
-
 void DolphinDetailsView::setZoomLevel(int level)
 {
     const int size = ZoomLevelInfo::iconSizeForZoomLevel(level);
@@ -900,10 +879,6 @@ void DolphinDetailsView::updateDecorationSize(bool showPreview)
     setIconSize(QSize(iconSize, iconSize));
     m_decorationSize = QSize(iconSize, iconSize);
 
-    if (m_selectionManager != 0) {
-        m_selectionManager->reset();
-    }
-
     doItemsLayout();
 }