[Marble-commits] KDE/kdeedu/marble/src/lib

Bastian Holst bastianholst at gmx.de
Fri Apr 30 22:40:40 CEST 2010


SVN commit 1121219 by bholst:

Upon mouse move, iterating the float items (to see whether the input handler needs to process it or not) is not necessary. Therefore, let's do a quick culling before we enter the loop. Same for visible selection rubber.
Patch by Ariya Hidayat

 M  +5 -3      MarbleWidgetInputHandler.cpp  


--- trunk/KDE/kdeedu/marble/src/lib/MarbleWidgetInputHandler.cpp #1121218:1121219
@@ -448,16 +448,18 @@
         // Do not handle (and therefore eat) mouse press and release events
         // that occur above visible float items. Mouse motion events are still
         // handled, however.
+        if ( e->type() != QEvent::MouseMove
+             && !d->m_selectionRubber->isVisible() )
+        {
         foreach ( AbstractFloatItem *floatItem, MarbleWidgetInputHandler::d->m_widget->floatItems() ) {
             if ( floatItem->enabled() && floatItem->visible()
-                 && floatItem->contains( event->pos() )
-                 && e->type() != QEvent::MouseMove
-                 && !d->m_selectionRubber->isVisible())
+                     && floatItem->contains( event->pos() ) )
             {
                 d->m_lmbTimer.stop();                
                 return false;
             }
         }
+        }
 
         // emit the position string only if the signal got attached
         if ( MarbleWidgetInputHandler::d->m_positionSignalConnected ) {


More information about the Marble-commits mailing list