┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-04-06 21:01:05 +0000
committerPeter Penz <[email protected]>2008-04-06 21:01:05 +0000
commit955cefdcf31e597610996d205056a872294719e5 (patch)
tree20276f910419f3d6b6410954aadae12b503635eb /src
parent21ab734b41420a2d8ae5bb5ea8a7ff626647b64d (diff)
fix selection regression that has been introduced by synchronizing the current index with the selected index
BUG: 158649 svn path=/trunk/KDE/kdebase/apps/; revision=794189
Diffstat (limited to 'src')
-rw-r--r--src/dolphindetailsview.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp
index 1a9b6f4da..dc9048225 100644
--- a/src/dolphindetailsview.cpp
+++ b/src/dolphindetailsview.cpp
@@ -355,7 +355,17 @@ void DolphinDetailsView::wheelEvent(QWheelEvent* event)
void DolphinDetailsView::currentChanged(const QModelIndex& current, const QModelIndex& previous)
{
QTreeView::currentChanged(current, previous);
- selectionModel()->select(current, QItemSelectionModel::ClearAndSelect);
+
+ // Stay consistent with QListView: When changing the current index by key presses,
+ // also change the selection.
+ const Qt::KeyboardModifiers modifier = QApplication::keyboardModifiers();
+ const bool adjustSelection = !(modifier & Qt::ShiftModifier) &&
+ !(modifier & Qt::ControlModifier) &&
+ !m_showElasticBand;
+
+ if (adjustSelection) {
+ selectionModel()->select(current, QItemSelectionModel::ClearAndSelect);
+ }
}
void DolphinDetailsView::setSortIndicatorSection(DolphinView::Sorting sorting)