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/dolphincolumnview.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/dolphincolumnview.cpp')
| -rw-r--r-- | src/dolphincolumnview.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/dolphincolumnview.cpp b/src/dolphincolumnview.cpp index 979ff7649..6df71cc1e 100644 --- a/src/dolphincolumnview.cpp +++ b/src/dolphincolumnview.cpp @@ -503,6 +503,23 @@ void DolphinColumnView::reload() dirLister->openUrl(rootUrl, false, true); } +void DolphinColumnView::invertSelection() +{ + // TODO: this approach of inverting the selection is quite slow. It should + // be possible to speedup the implementation by using QItemSelection, but + // all adempts have failed yet... + + ColumnWidget* column = activeColumn(); + QItemSelectionModel* selModel = column->selectionModel(); + + KDirLister* dirLister = m_dolphinModel->dirLister(); + const KFileItemList list = dirLister->itemsForDir(column->url()); + foreach (KFileItem* item, list) { + const QModelIndex index = m_dolphinModel->indexForUrl(item->url()); + selModel->select(m_proxyModel->mapFromSource(index), QItemSelectionModel::Toggle); + } +} + void DolphinColumnView::showColumn(const KUrl& url) { const KUrl& rootUrl = m_columns[0]->url(); @@ -621,6 +638,11 @@ void DolphinColumnView::showColumn(const KUrl& url) expandToActiveUrl(); } +void DolphinColumnView::selectAll() +{ + activeColumn()->selectAll(); +} + bool DolphinColumnView::isIndexHidden(const QModelIndex& index) const { Q_UNUSED(index); |
