]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistcontroller.cpp
Merge remote-tracking branch 'origin/KDE/4.9'
[dolphin.git] / src / kitemviews / kitemlistcontroller.cpp
index 41a86324bb1f612a0ca81b122cb3aeccb8e09cab..697e04fefcc8fbabf48b765f712af2a9123baf24 100644 (file)
@@ -40,6 +40,7 @@
 #include <QGraphicsView>
 #include <QMimeData>
 #include <QTimer>
+#include <QAccessible>
 
 KItemListController::KItemListController(KItemModelBase* model, KItemListView* view, QObject* parent) :
     QObject(parent),
@@ -419,6 +420,8 @@ bool KItemListController::keyPressEvent(QKeyEvent* event)
 
     default:
         m_keyboardManager->addKeys(event->text());
+        // Make sure unconsumed events get propagated up the chain. #302329
+        event->ignore();
         return false;
     }
 
@@ -489,7 +492,16 @@ void KItemListController::slotAutoActivationTimeout()
         return;
     }
 
-    if (m_model->supportsDropping(index)) {
+    /* m_view->isUnderMouse() fixes a bug in the Folder-View-Panel and in the
+     * Places-Panel.
+     *
+     * Bug: When you drag a file onto a Folder-View-Item or a Places-Item and
+     * then move away before the auto-activation timeout triggers, than the
+     * item still becomes activated/expanded.
+     *
+     * See Bug 293200 and 305783
+     */
+    if (m_model->supportsDropping(index) && m_view->isUnderMouse()) {
         if (m_view->supportsItemExpanding() && m_model->isExpandable(index)) {
             const bool expanded = m_model->isExpanded(index);
             m_model->setExpanded(index, !expanded);
@@ -878,6 +890,8 @@ bool KItemListController::dropEvent(QGraphicsSceneDragDropEvent* event, const QT
         emit itemDropEvent(m_view->itemAt(pos), event);
     }
 
+    QAccessible::updateAccessibility(view(), 0, QAccessible::DragDropEnd);
+
     return true;
 }
 
@@ -1125,6 +1139,7 @@ void KItemListController::startDragging()
     drag->setHotSpot(hotSpot);
 
     drag->exec(Qt::MoveAction | Qt::CopyAction | Qt::LinkAction, Qt::CopyAction);
+    QAccessible::updateAccessibility(view(), 0, QAccessible::DragDropStart);
 }
 
 KItemListWidget* KItemListController::hoveredWidget() const