fmradio/fmradio/src/fmradiochannellistcontainer.cpp
branchRCL_3
changeset 3 42dc287846be
parent 0 f3d95d9c00ab
child 6 3cb097cb90f8
--- a/fmradio/fmradio/src/fmradiochannellistcontainer.cpp	Tue Feb 02 00:17:10 2010 +0200
+++ b/fmradio/fmradio/src/fmradiochannellistcontainer.cpp	Fri Feb 19 22:51:16 2010 +0200
@@ -527,6 +527,7 @@
         case EKeyUpArrow:
         	if ( iMoveAction )	
         		{
+                iKeyMoveActivated = ETrue;
         		MoveUpL();
 	            }
         	else
@@ -541,6 +542,7 @@
         case EKeyDownArrow:
         	if ( iMoveAction )	
         		{
+                iKeyMoveActivated = ETrue;
         		MoveDownL();
 	            }
         	else
@@ -638,11 +640,11 @@
 //
 void CFMRadioChannelListContainer::ActivateMoveL()
     {
-    
     iMoveAction = ETrue;
     iMoveIndex = iChannelList->CurrentItemIndex();
     iTouchMoveIndex = iMoveIndex;
     UpdateItemIconL( iMoveIndex, KMoveIconIndexChList );
+    iKeyMoveActivated = EFalse;;
 	}
 
 // ---------------------------------------------------------
@@ -926,32 +928,33 @@
 // ---------------------------------------------------------
 //
 TBool CFMRadioChannelListContainer::MoveCanceledL()
-	{
-	TBool wasmove = EFalse;
-	
-	if ( iMoveAction )
-		{
-		iMoveAction = EFalse;
-		
-		TInt index = iChannelList->CurrentItemIndex();
-		
-		HBufC* channelItem = HBufC::NewLC( KLengthOfChannelItemString );
-		channelItem->Des().Copy( iChannelItemArray->MdcaPoint( index ) );
-		TPtr ptr( channelItem->Des() );	
-		
-		TBuf<KLengthOfChannelItemIconIndexString> textChIconIndex;
-		TPtrC iconIndexPtr( textChIconIndex );
-	  	TInt err = TextUtils::ColumnText( iconIndexPtr, 3, &ptr );
-		iChannelItemArray->Delete( index );
-	    iChannelList->HandleItemRemovalL();
-	    
-	    iChannelItemArray->InsertL( iMoveIndex, *channelItem );
-	    iChannelList->HandleItemAdditionL();
-	    iChannelList->SetCurrentItemIndex( iMoveIndex );	    
-        CleanupStack::PopAndDestroy( channelItem );
+    {
+    TBool wasmove = EFalse;
+    
+    if ( iMoveAction )
+        {
+        HideIconsL();
+        iMoveAction = EFalse;
         
-        iChannelList->ScrollToMakeItemVisible( index );
-        HideIconsL();
+        if ( iKeyMoveActivated )
+            {
+			TInt index = iChannelList->CurrentItemIndex();
+            HBufC* channelItem = HBufC::NewLC( KLengthOfChannelItemString );
+            channelItem->Des().Copy( iChannelItemArray->MdcaPoint( index ) );
+            TPtr ptr( channelItem->Des() );	
+            
+            TBuf<KLengthOfChannelItemIconIndexString> textChIconIndex;
+            TPtrC iconIndexPtr( textChIconIndex );
+            TInt err = TextUtils::ColumnText( iconIndexPtr, 3, &ptr );
+            iChannelItemArray->Delete( index );
+            iChannelList->HandleItemRemovalL();
+            
+            iChannelItemArray->InsertL( iMoveIndex, *channelItem );
+            iChannelList->HandleItemAdditionL();
+            iChannelList->SetCurrentItemIndex( iMoveIndex );
+            CleanupStack::PopAndDestroy( channelItem );
+            iChannelList->ScrollToMakeItemVisible( index );
+            }
         iChannelList->UpdateScrollBarsL();
         iChannelList->DrawDeferred();
         wasmove = ETrue;