]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Update the internal state only, if no expanding/collapsing area has been hit (otherwi...
authorPeter Penz <peter.penz19@gmail.com>
Sun, 11 May 2008 18:37:33 +0000 (18:37 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sun, 11 May 2008 18:37:33 +0000 (18:37 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=806561

src/dolphindetailsview.cpp

index 29ee90830fba5b164f4b2bd85d3b0b620dba2a15..e33d94c18c74097f1c368cd6c54a88974127fc68 100644 (file)
@@ -188,9 +188,16 @@ void DolphinDetailsView::mousePressEvent(QMouseEvent* event)
     QTreeView::mousePressEvent(event);
 
     const QModelIndex index = indexAt(event->pos());
-    if (index.isValid() && (event->button() == Qt::LeftButton)) {
-        // TODO: see comment in DolphinIconsView::mousePressEvent()
-        setState(QAbstractItemView::DraggingState);
+    const bool updateState = index.isValid() &&
+                             (index.column() == DolphinModel::Name) &&
+                             (event->button() == Qt::LeftButton);
+    if (updateState) {
+        // TODO: See comment in DolphinIconsView::mousePressEvent(). Only update
+        // the state if no expanding/collapsing area has been hit:
+        const QRect rect = visualRect(index);
+        if (event->pos().x() >= rect.x() + indentation()) {
+            setState(QAbstractItemView::DraggingState);
+        }
     }
 
     if (!index.isValid() || (index.column() != DolphinModel::Name)) {