#include "dolphinviewautoscroller.h"
#include "draganddrophelper.h"
#include "selectionmanager.h"
+#include "viewextensionsfactory.h"
#include "viewproperties.h"
#include "zoomlevelinfo.h"
#include <klocale.h>
#include <kmenu.h>
-#include <QAbstractProxyModel>
#include <QAction>
#include <QApplication>
#include <QHeaderView>
#include <QPainter>
#include <QScrollBar>
-DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* controller) :
+DolphinDetailsView::DolphinDetailsView(QWidget* parent,
+ DolphinController* controller,
+ DolphinSortFilterProxyModel* proxyModel) :
QTreeView(parent),
m_autoResize(true),
m_expandingTogglePressed(false),
setRootIsDecorated(settings->expandableFolders());
setItemsExpandable(settings->expandableFolders());
setEditTriggers(QAbstractItemView::NoEditTriggers);
+ setModel(proxyModel);
setMouseTracking(true);
m_autoScroller = new DolphinViewAutoScroller(this);
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()),
m_expandableFoldersAction->setCheckable(true);
connect(m_expandableFoldersAction, SIGNAL(toggled(bool)),
this, SLOT(setFoldersExpandable(bool)));
+
+ new ViewExtensionsFactory(this, controller);
}
DolphinDetailsView::~DolphinDetailsView()
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);
updateDecorationSize(showPreview);
}
-
void DolphinDetailsView::slotShowPreviewChanged()
{
const DolphinView* view = m_controller->dolphinView();