+ m_mainWindow->dropUrls(urls, destination);
+}
+
+
+void DolphinView::updateSorting(DolphinView::Sorting sorting)
+{
+ ViewProperties props(url());
+ props.setSorting(sorting);
+
+ m_proxyModel->setSorting(sorting);
+
+ emit sortingChanged(sorting);
+}
+
+void DolphinView::updateSortOrder(Qt::SortOrder order)
+{
+ ViewProperties props(url());
+ props.setSortOrder(order);
+
+ m_proxyModel->setSortOrder(order);
+
+ emit sortOrderChanged(order);
+}
+
+void DolphinView::emitContentsMoved()
+{
+ emit contentsMoved(contentsX(), contentsY());
+}
+
+void DolphinView::updateActivationState()
+{
+ m_urlNavigator->setActive(isActive());
+}
+
+void DolphinView::createView()
+{
+ // delete current view
+ QAbstractItemView* view = itemView();
+ if (view != 0) {
+ m_topLayout->removeWidget(view);
+ view->close();
+ view->deleteLater();
+ m_iconsView = 0;
+ m_detailsView = 0;
+ }
+
+ assert(m_iconsView == 0);
+ assert(m_detailsView == 0);
+
+ // ... and recreate it representing the current mode
+ switch (m_mode) {
+ case IconsView:
+ m_iconsView = new DolphinIconsView(this, m_controller);
+ view = m_iconsView;
+ break;
+
+ case DetailsView:
+ m_detailsView = new DolphinDetailsView(this, m_controller);
+ view = m_detailsView;
+ break;
+ }
+
+ view->setModel(m_proxyModel);
+ view->setSelectionMode(QAbstractItemView::ExtendedSelection);
+
+ KFileItemDelegate* delegate = new KFileItemDelegate(this);
+ delegate->setAdditionalInformation(KFileItemDelegate::FriendlyMimeType);
+ view->setItemDelegate(delegate);
+
+ new KMimeTypeResolver(view, m_dirModel);
+ m_topLayout->insertWidget(1, view);
+
+ connect(view->selectionModel(), SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)),
+ m_controller, SLOT(indicateSelectionChange()));
+ connect(view->verticalScrollBar(), SIGNAL(valueChanged(int)),
+ this, SLOT(emitContentsMoved()));
+ connect(view->horizontalScrollBar(), SIGNAL(valueChanged(int)),
+ this, SLOT(emitContentsMoved()));
+}
+
+void DolphinView::selectAll(QItemSelectionModel::SelectionFlags flags)
+{
+ QItemSelectionModel* selectionModel = itemView()->selectionModel();
+ const QAbstractItemModel* itemModel = selectionModel->model();
+
+ const QModelIndex topLeft = itemModel->index(0, 0);
+ const QModelIndex bottomRight = itemModel->index(itemModel->rowCount() - 1,
+ itemModel->columnCount() - 1);
+
+ QItemSelection selection(topLeft, bottomRight);
+ selectionModel->select(selection, flags);
+}
+
+QAbstractItemView* DolphinView::itemView() const
+{
+ assert((m_iconsView == 0) || (m_detailsView == 0));
+ if (m_detailsView != 0) {
+ return m_detailsView;
+ }
+ return m_iconsView;