diff options
| author | Peter Penz <[email protected]> | 2007-09-25 13:53:08 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2007-09-25 13:53:08 +0000 |
| commit | 41f8286a568f01bc2723eb74e763556b4c397546 (patch) | |
| tree | 4ecb9bd1c530dc7ce27b64c2eaee1a1881a2479e /src/dolphinview.cpp | |
| parent | 1db9b6c3c4d494e055696e5d96629f33ea109abc (diff) | |
assure that "Select All" and "Invert Selection" only operate on the active column of the column-view instead of selecting the whole hierarchy of the model
svn path=/trunk/KDE/kdebase/apps/; revision=716885
Diffstat (limited to 'src/dolphinview.cpp')
| -rw-r--r-- | src/dolphinview.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index dc8c8dd87..a85e2db9b 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -252,15 +252,24 @@ void DolphinView::selectAll() void DolphinView::invertSelection() { - QItemSelectionModel* selectionModel = itemView()->selectionModel(); - const QAbstractItemModel* itemModel = selectionModel->model(); + 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 QModelIndex topLeft = itemModel->index(0, 0); + const QModelIndex bottomRight = itemModel->index(itemModel->rowCount() - 1, + itemModel->columnCount() - 1); - QItemSelection selection(topLeft, bottomRight); - selectionModel->select(selection, QItemSelectionModel::Toggle); + const QItemSelection selection(topLeft, bottomRight); + selectionModel->select(selection, QItemSelectionModel::Toggle); + } } bool DolphinView::hasSelection() const |
