- return m_iconsView != 0;
-}
-
-void DolphinView::selectAll()
-{
- QAbstractItemView* view = itemView();
- // TODO: there seems to be a bug in QAbstractItemView::selectAll(); if
- // the Ctrl-key is pressed (e. g. for Ctrl+A), selectAll() inverts the
- // selection instead of selecting all items. This is bypassed for KDE 4.0
- // by invoking clearSelection() first.
- view->clearSelection();
- view->selectAll();
-}
-
-void DolphinView::invertSelection()
-{
- if (isColumnViewActive()) {
- // QAbstractItemView does not offer a virtual method invertSelection()
- // as counterpart to QAbstractItemView::selectAll(). This makes it
- // necessary to delegate the inverting of the selection to the
- // column view, as only the selection of the active column should
- // get inverted.
- m_columnView->invertSelection();
- } else {
- 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);
-
- const QItemSelection selection(topLeft, bottomRight);
- selectionModel->select(selection, QItemSelectionModel::Toggle);
- }