]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphiniconsview.cpp
Adapt Dolphin Nepomuk support to namespace changes.
[dolphin.git] / src / dolphiniconsview.cpp
index a4d7fe454584341905b6553cd84005ffdec675e1..d21ffba32752ebfd42b8257a7a5aab67125dcd78 100644 (file)
 
 #include "dolphin_iconsmodesettings.h"
 
-#include <kdirmodel.h>
-#include <kfileitem.h>
-#include <kfileitemdelegate.h>
-
 #include <QAbstractProxyModel>
 #include <QApplication>
 #include <QPainter>
@@ -110,6 +106,7 @@ void DolphinIconsView::contextMenuEvent(QContextMenuEvent* event)
 
 void DolphinIconsView::mousePressEvent(QMouseEvent* event)
 {
+    m_controller->triggerActivation();
     if (!indexAt(event->pos()).isValid()) {
         const Qt::KeyboardModifiers modifier = QApplication::keyboardModifiers();
         if (!(modifier & Qt::ShiftModifier) && !(modifier & Qt::ControlModifier)) {
@@ -120,12 +117,6 @@ void DolphinIconsView::mousePressEvent(QMouseEvent* event)
     KListView::mousePressEvent(event);
 }
 
-void DolphinIconsView::mouseReleaseEvent(QMouseEvent* event)
-{
-    KListView::mouseReleaseEvent(event);
-    m_controller->triggerActivation();
-}
-
 void DolphinIconsView::dragEnterEvent(QDragEnterEvent* event)
 {
     if (event->mimeData()->hasUrls()) {
@@ -134,6 +125,15 @@ void DolphinIconsView::dragEnterEvent(QDragEnterEvent* event)
     m_dragging = true;
 }
 
+void DolphinIconsView::dragLeaveEvent(QDragLeaveEvent* event)
+{
+    KListView::dragLeaveEvent(event);
+
+    // TODO: remove this code when the issue #160611 is solved in Qt 4.4
+    m_dragging = false;
+    setDirtyRegion(m_dropRect);
+}
+
 void DolphinIconsView::dragMoveEvent(QDragMoveEvent* event)
 {
     KListView::dragMoveEvent(event);