]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphindetailsview.cpp
let Dolphin use the new tab-close-buttons
[dolphin.git] / src / dolphindetailsview.cpp
index 2eb631a649bb87ca8aba7d895db156ac54b5fab3..470cafa1d1e15ceb3e7c46bb8aca9b5a11de9eab 100644 (file)
@@ -66,9 +66,9 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr
     setAlternatingRowColors(true);
     setRootIsDecorated(settings->expandableFolders());
     setItemsExpandable(settings->expandableFolders());
+    setEditTriggers(QAbstractItemView::NoEditTriggers);
 
     setMouseTracking(true);
-    viewport()->setAttribute(Qt::WA_Hover);
 
     const ViewProperties props(controller->url());
     setSortIndicatorSection(props.sorting());
@@ -355,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)