]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphindetailsview.cpp
let Dolphin use the new tab-close-buttons
[dolphin.git] / src / dolphindetailsview.cpp
index 53bf4e2a7026a241465a71bd554bb59535638dd7..470cafa1d1e15ceb3e7c46bb8aca9b5a11de9eab 100644 (file)
@@ -66,6 +66,7 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr
     setAlternatingRowColors(true);
     setRootIsDecorated(settings->expandableFolders());
     setItemsExpandable(settings->expandableFolders());
+    setEditTriggers(QAbstractItemView::NoEditTriggers);
 
     setMouseTracking(true);
 
@@ -354,7 +355,12 @@ 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.
+    if (QApplication::mouseButtons() == Qt::NoButton) {
+        selectionModel()->select(current, QItemSelectionModel::ClearAndSelect);
+    }
 }
 
 void DolphinDetailsView::setSortIndicatorSection(DolphinView::Sorting sorting)