┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-05-04 18:24:28 +0000
committerPeter Penz <[email protected]>2008-05-04 18:24:28 +0000
commit03aa2029d7c65071d054444c375e2ddb89ea6f12 (patch)
tree5d8e170ea79fd25e54cd3e514c2845ed3f2dc5ba /src
parenta2683d98744c66e58b2473cea0957086e817f4a3 (diff)
Fixed issue that sometimes the dragging from an inactive view to an active view does not work. Note that this is just a workaround, QAbstractItemView should take care about this itself. I tried to provide a Qt-only example for this, but it is more tricky than I thought: it seems some expensive operations are required, so that the position of the second mouse-move event is outside the item area... I'll retest this issue without workaround if Qt 4.4 final is out.
BUG: 154619 svn path=/trunk/KDE/kdebase/apps/; revision=803980
Diffstat (limited to 'src')
-rw-r--r--src/dolphincolumnwidget.cpp4
-rw-r--r--src/dolphindetailsview.cpp6
-rw-r--r--src/dolphiniconsview.cpp12
3 files changed, 21 insertions, 1 deletions
diff --git a/src/dolphincolumnwidget.cpp b/src/dolphincolumnwidget.cpp
index cf2ae7656..a380dc52b 100644
--- a/src/dolphincolumnwidget.cpp
+++ b/src/dolphincolumnwidget.cpp
@@ -337,6 +337,10 @@ void DolphinColumnWidget::paintEvent(QPaintEvent* event)
void DolphinColumnWidget::mousePressEvent(QMouseEvent* event)
{
requestActivation();
+ if (indexAt(event->pos()).isValid() && (event->button() == Qt::LeftButton)) {
+ // TODO: see comment in DolphinIconsView::mousePressEvent()
+ setState(QAbstractItemView::DraggingState);
+ }
QListView::mousePressEvent(event);
}
diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp
index 08d03fb0b..29ee90830 100644
--- a/src/dolphindetailsview.cpp
+++ b/src/dolphindetailsview.cpp
@@ -188,6 +188,11 @@ 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);
+ }
+
if (!index.isValid() || (index.column() != DolphinModel::Name)) {
const Qt::KeyboardModifiers modifier = QApplication::keyboardModifiers();
if (!(modifier & Qt::ShiftModifier) && !(modifier & Qt::ControlModifier)) {
@@ -250,6 +255,7 @@ void DolphinDetailsView::mouseReleaseEvent(QMouseEvent* event)
void DolphinDetailsView::startDrag(Qt::DropActions supportedActions)
{
DragAndDropHelper::startDrag(this, supportedActions);
+ m_showElasticBand = false;
}
void DolphinDetailsView::dragEnterEvent(QDragEnterEvent* event)
diff --git a/src/dolphiniconsview.cpp b/src/dolphiniconsview.cpp
index a9659739a..2e6d7dca6 100644
--- a/src/dolphiniconsview.cpp
+++ b/src/dolphiniconsview.cpp
@@ -167,7 +167,17 @@ void DolphinIconsView::contextMenuEvent(QContextMenuEvent* event)
void DolphinIconsView::mousePressEvent(QMouseEvent* event)
{
m_controller->requestActivation();
- if (!indexAt(event->pos()).isValid()) {
+ const QModelIndex index = indexAt(event->pos());
+ if (index.isValid() && (event->button() == Qt::LeftButton)) {
+ // TODO: It should not be necessary to manually set the dragging state, but I could
+ // not reproduce this issue with a Qt-only example yet to find the root cause.
+ // Issue description: start Dolphin, split the view and drag an item from the
+ // inactive view to the active view by a very fast mouse movement. Result:
+ // the item gets selected instead of being dragged...
+ setState(QAbstractItemView::DraggingState);
+ }
+
+ if (!index.isValid()) {
const Qt::KeyboardModifiers modifier = QApplication::keyboardModifiers();
if (!(modifier & Qt::ShiftModifier) && !(modifier & Qt::ControlModifier)) {
clearSelection();