diff options
| author | Peter Penz <[email protected]> | 2007-09-14 20:50:08 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2007-09-14 20:50:08 +0000 |
| commit | 26b2ce327f715c805f6cf524d041b30866e41538 (patch) | |
| tree | d23fdcd87e5393a44ed50b7652144b1ba99d7400 /src/dolphinview.cpp | |
| parent | 0ba0441fc861ae6c30cc26d6644f26e5afc1cd3c (diff) | |
refactoring of column view, which fixes:
* selection issues
* unwanted loading of sub directories
* wrong horizontal scroll position
svn path=/trunk/KDE/kdebase/apps/; revision=712590
Diffstat (limited to 'src/dolphinview.cpp')
| -rw-r--r-- | src/dolphinview.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 3e8070cb3..0041ab35d 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -262,22 +262,15 @@ void DolphinView::selectAll() void DolphinView::invertSelection() { - if (isColumnViewActive()) { - // In opposite to QAbstractItemView::selectAll() there is no virtual method - // for adjusting the invertion of a selection. As the generic approach by using - // the selection model does not work for the column view, we delegate this task: - m_columnView->invertSelection(); - } else { - QItemSelectionModel* selectionModel = itemView()->selectionModel(); - const QAbstractItemModel* itemModel = selectionModel->model(); + 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); - } + QItemSelection selection(topLeft, bottomRight); + selectionModel->select(selection, QItemSelectionModel::Toggle); } bool DolphinView::hasSelection() const @@ -332,7 +325,11 @@ KFileItem DolphinView::fileItem(const QModelIndex& index) const void DolphinView::setContentsPosition(int x, int y) { QAbstractItemView* view = itemView(); - view->horizontalScrollBar()->setValue(x); + + // the ColumnView takes care itself for the horizontal scrolling + if (!isColumnViewActive()) { + view->horizontalScrollBar()->setValue(x); + } view->verticalScrollBar()->setValue(y); m_loadingDirectory = false; |
