#include "dolphinsortfilterproxymodel.h"
#include "dolphinviewautoscroller.h"
#include "draganddrophelper.h"
-#include "selectionmanager.h"
#include "viewextensionsfactory.h"
#include "viewproperties.h"
#include "zoomlevelinfo.h"
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(),
setModel(proxyModel);
setMouseTracking(true);
- m_autoScroller = new DolphinViewAutoScroller(this);
const ViewProperties props(controller->url());
setSortIndicatorSection(props.sorting());
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()),
connect(view, SIGNAL(showPreviewChanged()),
this, SLOT(slotShowPreviewChanged()));
- updateDecorationSize(view->showPreview());
setFocus();
viewport()->installEventFilter(this);
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()
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();
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.
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);
setIconSize(QSize(iconSize, iconSize));
m_decorationSize = QSize(iconSize, iconSize);
- if (m_selectionManager != 0) {
- m_selectionManager->reset();
- }
-
doItemsLayout();
}