]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/selectiontoggle.cpp
Internal cleanup: Remove public method selectedUrls() from DolphinView to keep the...
[dolphin.git] / src / views / selectiontoggle.cpp
index 3ab40ebdcebda2e868c4b70665efd289ebb12743..c1272fa0f764385131dc65e1df264e4e8497adc0 100644 (file)
 #include <QTimer>
 #include <QTimeLine>
 
+#include <kdebug.h>
+
 SelectionToggle::SelectionToggle(QWidget* parent) :
     QAbstractButton(parent),
     m_isHovered(false),
     m_leftMouseButtonPressed(false),
-    m_appliedArrowCursor(false),
     m_fadingValue(0),
     m_margin(0),
     m_icon(),
@@ -106,25 +107,12 @@ void SelectionToggle::setVisible(bool visible)
 
 bool SelectionToggle::eventFilter(QObject* obj, QEvent* event)
 {
-    if (obj == parent()) {
-        switch (event->type()) {
-        case QEvent::Leave:
-            hide();
-            break;
-
-        case QEvent::MouseMove:
-            if (m_leftMouseButtonPressed) {
-                // Don't forward mouse move events to the viewport,
-                // otherwise a rubberband selection will be shown when
-                // clicking on the selection toggle and moving the mouse
-                // above the viewport.
-                return true;
-            }
-            break;
-
-        default:
-            break;
-        }
+    if ((obj == parent()) && (event->type() == QEvent::MouseMove) && m_leftMouseButtonPressed) {
+        // Don't forward mouse move events to the viewport,
+        // otherwise a rubberband selection will be shown when
+        // clicking on the selection toggle and moving the mouse
+        // above the viewport.
+        return true;
     }
 
     return QAbstractButton::eventFilter(obj, event);
@@ -134,11 +122,6 @@ void SelectionToggle::enterEvent(QEvent* event)
 {
     QAbstractButton::enterEvent(event);
 
-    if (!m_appliedArrowCursor) {
-        QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
-        m_appliedArrowCursor = true;
-    }
-
     // if the mouse cursor is above the selection toggle, display
     // it immediately without fading timer
     m_isHovered = true;
@@ -155,11 +138,6 @@ void SelectionToggle::leaveEvent(QEvent* event)
 {
     QAbstractButton::leaveEvent(event);
 
-    if (m_appliedArrowCursor) {
-        QApplication::restoreOverrideCursor();
-        m_appliedArrowCursor = false;
-    }
-
     m_isHovered = false;
     update();
 }