673 TFileName resourceFileName; |
673 TFileName resourceFileName; |
674 resourceFileName.Append( KRadioSettingsResourceFile ); |
674 resourceFileName.Append( KRadioSettingsResourceFile ); |
675 |
675 |
676 //User::LeaveIfError( iRadioSettingsImp.FsSession().Connect() ); |
676 //User::LeaveIfError( iRadioSettingsImp.FsSession().Connect() ); |
677 |
677 |
|
678 //TODO: Remove the ResolveDriveL |
678 iRadioSettingsImp.ResolveDriveL( resourceFileName, KDC_RESOURCE_FILES_DIR ); |
679 iRadioSettingsImp.ResolveDriveL( resourceFileName, KDC_RESOURCE_FILES_DIR ); |
679 BaflUtils::NearestLanguageFile( iRadioSettingsImp.FsSession(), resourceFileName); |
680 BaflUtils::NearestLanguageFile( iRadioSettingsImp.FsSession(), resourceFileName); |
680 |
681 |
681 iResFile.OpenL( iRadioSettingsImp.FsSession(), resourceFileName); |
682 iResFile.OpenL( iRadioSettingsImp.FsSession(), resourceFileName); |
682 |
683 |
683 iResFile.ConfirmSignatureL(); |
684 iResFile.ConfirmSignatureL(); |
684 HBufC8* readBuffer = iResFile.AllocReadLC(R_QRAD_REGIONS); |
685 HBufC8* readBuffer = iResFile.AllocReadLC(R_QRAD_REGIONS); |
685 reader.SetBuffer(readBuffer); |
686 reader.SetBuffer(readBuffer); |
686 TInt regionCount = reader.ReadInt16(); |
687 TInt regionCount = reader.ReadInt16(); |
687 |
688 |
688 for ( TInt i = 0 ; i < regionCount; i++ ) |
689 for ( TInt i = 0; i < regionCount; ++i ) |
689 { |
690 { |
690 TInt resId = reader.ReadInt32(); // The next resource ID to read. |
691 TInt resId = reader.ReadInt32(); // The next resource ID to read. |
691 HBufC8* regionBuffer = iResFile.AllocReadLC(resId); |
692 HBufC8* regionBuffer = iResFile.AllocReadLC(resId); |
692 TResourceReader regionReader; |
693 TResourceReader regionReader; |
693 regionReader.SetBuffer(regionBuffer); |
694 regionReader.SetBuffer(regionBuffer); |