diff -r f73067c3e563 -r 0004e923f486 fmradio/fmradio/src/fmradiochannellistcontainer.cpp --- a/fmradio/fmradio/src/fmradiochannellistcontainer.cpp Wed Apr 14 15:57:41 2010 +0300 +++ b/fmradio/fmradio/src/fmradiochannellistcontainer.cpp Tue Apr 27 16:38:14 2010 +0300 @@ -223,60 +223,57 @@ // values specified // ---------------------------------------------------- // -void CFMRadioChannelListContainer::UpdateChannelListContentL( TInt aIndex, const TDesC& aChannelName, TInt aChannelFrequency ) - { +void CFMRadioChannelListContainer::UpdateChannelListContentL( TInt aIndex, + const TDesC& aChannelName, + TInt aChannelFrequency ) + { TBuf textChannelItem; TBuf textChIndex; TBuf textChIconIndex; - + textChIndex.Format( KChIndexFormatChList, aIndex+1 ); // One over index - + textChIconIndex.Format( KChIconIndexFormatChList, KNowPlayingIconIndexChList ); + + //Update to display Devnagari numbers for Text Index. + AknTextUtils::LanguageSpecificNumberConversion( textChIndex ); - //Update to display Devnagari numbers for Text Index. - AknTextUtils::LanguageSpecificNumberConversion( textChIndex ); - // textChannelItem.Append( textChIndex ); textChannelItem.Append( KColumnListSeparator ); textChannelItem.Append( aChannelName ); textChannelItem.Append( KColumnListSeparator ); if ( aChannelFrequency ) - { - TReal frequency = static_cast( aChannelFrequency / static_cast( KHzConversionFactor )); - // Gets locale decimal separator automatically - TRealFormat format(KFrequencyMaxLength, iRadioEngine.DecimalCount() ); - TBuf<30> frequencyString; - frequencyString.Num( frequency, format ); - - HBufC* stringHolder = StringLoader::LoadLC( R_QTN_FMRADIO_DOUBLE2_FREQ, frequencyString, iEikonEnv ); - //Update for display of Hindi Devnagari Numbers - TPtr textItem2 = stringHolder->Des(); - AknTextUtils::LanguageSpecificNumberConversion(textItem2); - textChannelItem.Append( textItem2 ); - CleanupStack::PopAndDestroy( stringHolder ); - } + { + TReal frequency = static_cast( aChannelFrequency / static_cast( KHzConversionFactor )); + // Gets locale decimal separator automatically + TRealFormat format(KFrequencyMaxLength, iRadioEngine.DecimalCount() ); + TBuf<30> frequencyString; + frequencyString.Num( frequency, format ); + + HBufC* stringHolder = StringLoader::LoadLC( R_QTN_FMRADIO_DOUBLE2_FREQ, frequencyString, iEikonEnv ); + //Update for display of Hindi Devnagari Numbers + TPtr textItem2 = stringHolder->Des(); + AknTextUtils::LanguageSpecificNumberConversion(textItem2); + textChannelItem.Append( textItem2 ); + CleanupStack::PopAndDestroy( stringHolder ); + } // Set 'Now Playing' icon to the channel item textChannelItem.Append( KColumnListSeparator ); - + if ( iRadioEngine.GetPresetIndex() == aIndex ) - { + { textChannelItem.Append( textChIconIndex ); - } + } - if( iChannelItemArray->Count() > 0 ) - { - iChannelItemArray->Delete( aIndex ); - iChannelList->HandleItemRemovalL(); - iChannelItemArray->InsertL( aIndex, textChannelItem ); - //iChannelItemArray->AppendL( textChannelItem ); - - iChannelList->HandleItemAdditionL(); // Update list - iChannelList->UpdateScrollBarsL(); - iChannelList->DrawDeferred(); - } - } + if ( aIndex < iChannelItemArray->Count() && aIndex >= 0 ) + { + iChannelItemArray->Delete( aIndex ); + iChannelItemArray->InsertL( aIndex, textChannelItem ); + iChannelList->DrawDeferred(); + } + } // ---------------------------------------------------- // CFMRadioChannelListContainer::RemoveChannelL @@ -416,11 +413,8 @@ ptr.Append( textChIconIndex ); // Add icon index iChannelItemArray->Delete( aIndex ); - iChannelList->HandleItemRemovalL(); iChannelItemArray->InsertL( aIndex, *channelItem ); CleanupStack::PopAndDestroy( channelItem ); - iChannelList->HandleItemAdditionL(); // Update list - iChannelList->UpdateScrollBarsL(); } // use draw now so that view is up to date during fast channel switching iChannelList->DrawNow(); @@ -447,10 +441,7 @@ { ptr.Delete( ptr.Length() - iconIndexPtr.Length(), iconIndexPtr.Length() ); // Remove icon index iChannelItemArray->Delete( index ); - iChannelList->HandleItemRemovalL(); iChannelItemArray->InsertL( index, *channelItem ); - iChannelList->HandleItemAdditionL(); // Update list - iChannelList->UpdateScrollBarsL(); } CleanupStack::PopAndDestroy( channelItem ); }