src/hbwidgets/itemviews/hbabstractitemview_p.cpp
changeset 6 c3690ec91ef8
parent 5 627c4a0fd0e7
child 21 4633027730f5
child 34 ed14f46c0e55
--- a/src/hbwidgets/itemviews/hbabstractitemview_p.cpp	Fri Jun 11 13:58:22 2010 +0300
+++ b/src/hbwidgets/itemviews/hbabstractitemview_p.cpp	Wed Jun 23 18:33:25 2010 +0300
@@ -60,10 +60,10 @@
     mPostponedScrollHint(HbAbstractItemView::PositionAtTop),
     mPreviousSelectedCommand(QItemSelectionModel::NoUpdate),
     mAnimationTimer(0),
-	mModelIterator(0),
+    mModelIterator(0),
     mEnabledAnimations(HbAbstractItemView::All),
     mLongPressEnabled(true),
-	mDoingContiguousSelection(false)
+    mDoingContiguousSelection(false)
 {
 }
 
@@ -349,7 +349,7 @@
 bool HbAbstractItemViewPrivate::panTriggered(QGestureEvent *event)
 {
     Q_Q(HbAbstractItemView);
-
+    int retVal = false;
     HbPanGesture *gesture = static_cast<HbPanGesture *>(event->gesture(Qt::PanGesture));
 
     switch (gesture->state()) {
@@ -359,7 +359,6 @@
         case Qt::GestureUpdated: {
             QPointF scenePos = event->mapToGraphicsScene(gesture->hotSpot());
             if (mDoingContiguousSelection) {
-                int retVal = false;
 
                 // loop through the items in the scene
                 qreal scenePosY = scenePos.y();
@@ -380,7 +379,7 @@
                         mouseMoveEvent.setPos(position);
                         QItemSelectionModel::SelectionFlags command = q->selectionCommand(item, &mouseMoveEvent);
 
-						// in contiguousselectionarea there shall be no panning from HbScrollArea, thus return true
+                        // in contiguousselectionarea there shall be no panning from HbScrollArea, thus return true
                         if (command != QItemSelectionModel::NoUpdate) {
                             retVal = true;
                         }
@@ -427,9 +426,8 @@
                         break;
                     }
                 }
-                return retVal;
             }
-            else if (!mDoingContiguousSelection){
+            else {
                 HbWidgetFeedback::continuousTriggered(q, Hb::ContinuousScrolled);
             }
             break;
@@ -440,7 +438,7 @@
             if (mDoingContiguousSelection) {
                 stopAnimating();
                 mDoingContiguousSelection = false;
-                return true;
+                retVal = true;
             }
             else {
                 HbWidgetFeedback::continuousStopped(q, Hb::ContinuousScrolled);
@@ -450,8 +448,7 @@
         default:
             break;
     }
-
-    return false;
+    return retVal;
 }
 
 /*!
@@ -481,7 +478,7 @@
 
     mFrictionEnabled = mOrigFriction;
 
-    QObject::disconnect(q, SIGNAL(scrollPositionChanged(QPointF)), q, SLOT(_q_scrollingI(QPointF)));    
+    QObject::disconnect(q, SIGNAL(scrollPositionChanged(QPointF)), q, SLOT(_q_scrolling(QPointF)));    
     QObject::disconnect(q, SIGNAL(scrollingEnded()), q, SLOT(_q_scrollingEnded()));    
     QObject::disconnect(q, SIGNAL(scrollingStarted()), q, SLOT(_q_scrollingStarted()));    
 }
@@ -658,8 +655,8 @@
         case QEvent::GraphicsSceneMouseDoubleClick: {
 
             // check if the mouse click is in the multiselectionarea
-		    if (item->selectionAreaContains(static_cast<const QGraphicsSceneMouseEvent *>(event)->pos(), HbAbstractViewItem::MultiSelection)) {
-		        mSelectionSettings |= Selection;
+            if (item->selectionAreaContains(static_cast<const QGraphicsSceneMouseEvent *>(event)->pos(), HbAbstractViewItem::MultiSelection)) {
+                mSelectionSettings |= Selection;
                 if (mSelectionModel && mSelectionModel->isSelected(item->modelIndex())) {
                     mContSelectionAction = QItemSelectionModel::Deselect;
                 } else {