+ m_autoScroller = new DolphinViewAutoScroller(this);
+
+ const ViewProperties props(controller->url());
+ setSortIndicatorSection(props.sorting());
+ setSortIndicatorOrder(props.sortOrder());
+
+ QHeaderView* headerView = header();
+ connect(headerView, SIGNAL(sectionClicked(int)),
+ this, SLOT(synchronizeSortingState(int)));
+ headerView->setContextMenuPolicy(Qt::CustomContextMenu);
+ connect(headerView, SIGNAL(customContextMenuRequested(const QPoint&)),
+ this, SLOT(configureSettings(const QPoint&)));
+ connect(headerView, SIGNAL(sectionResized(int, int, int)),
+ this, SLOT(slotHeaderSectionResized(int, int, int)));
+ connect(headerView, SIGNAL(sectionHandleDoubleClicked(int)),
+ this, SLOT(disableAutoResizing()));
+
+ connect(parent, SIGNAL(sortingChanged(DolphinView::Sorting)),
+ this, SLOT(setSortIndicatorSection(DolphinView::Sorting)));
+ connect(parent, SIGNAL(sortOrderChanged(Qt::SortOrder)),
+ this, SLOT(setSortIndicatorOrder(Qt::SortOrder)));
+
+ connect(this, SIGNAL(clicked(const QModelIndex&)),
+ controller, SLOT(requestTab(const QModelIndex&)));
+ if (KGlobalSettings::singleClick()) {
+ connect(this, SIGNAL(clicked(const QModelIndex&)),
+ controller, SLOT(triggerItem(const QModelIndex&)));
+ } else {
+ connect(this, SIGNAL(doubleClicked(const QModelIndex&)),
+ 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(zoomLevelChanged(int)),
+ this, SLOT(setZoomLevel(int)));
+ connect(controller->dolphinView(), SIGNAL(additionalInfoChanged()),
+ this, SLOT(updateColumnVisibility()));
+ connect(controller, SIGNAL(activationChanged(bool)),
+ this, SLOT(slotActivationChanged(bool)));
+
+ if (settings->useSystemFont()) {
+ m_font = KGlobalSettings::generalFont();
+ } else {
+ m_font = QFont(settings->fontFamily(),
+ settings->fontSize(),
+ settings->fontWeight(),
+ settings->italicFont());
+ }
+
+ setVerticalScrollMode(QTreeView::ScrollPerPixel);
+ setHorizontalScrollMode(QTreeView::ScrollPerPixel);
+
+ const DolphinView* view = controller->dolphinView();
+ connect(view, SIGNAL(showPreviewChanged()),
+ this, SLOT(slotShowPreviewChanged()));
+
+ updateDecorationSize(view->showPreview());
+
+ setFocus();
+ viewport()->installEventFilter(this);
+
+ connect(KGlobalSettings::self(), SIGNAL(settingsChanged(int)),
+ this, SLOT(slotGlobalSettingsChanged(int)));
+
+ m_useDefaultIndexAt = false;
+
+ m_expandableFoldersAction = new QAction(i18nc("@option:check", "Expandable Folders"), this);
+ m_expandableFoldersAction->setCheckable(true);
+ connect(m_expandableFoldersAction, SIGNAL(toggled(bool)),
+ this, SLOT(setFoldersExpandable(bool)));