213 if( activeProfileId == KSilentProfileId ) |
213 if( activeProfileId == KSilentProfileId ) |
214 { |
214 { |
215 TInt generalProfileIndex( |
215 TInt generalProfileIndex( |
216 profileNamesArray->FindById( KGeneralProfileId ) ); |
216 profileNamesArray->FindById( KGeneralProfileId ) ); |
217 |
217 |
218 swapProfileName = |
218 if( generalProfileIndex > KErrNotFound ) |
219 profileNamesArray->MdcaPoint( generalProfileIndex ).AllocLC() ; |
219 { |
|
220 swapProfileName = |
|
221 profileNamesArray->MdcaPoint( generalProfileIndex ).AllocLC() ; |
|
222 } |
220 } |
223 } |
221 else |
224 else |
222 { |
225 { |
223 TInt silentProfileIndex( |
226 TInt silentProfileIndex( |
224 profileNamesArray->FindById( KSilentProfileId ) ); |
227 profileNamesArray->FindById( KSilentProfileId ) ); |
225 |
228 |
226 swapProfileName = |
229 if( silentProfileIndex > KErrNotFound ) |
227 profileNamesArray->MdcaPoint( silentProfileIndex ).AllocLC() ; |
230 { |
228 } |
231 swapProfileName = |
229 |
232 profileNamesArray->MdcaPoint( silentProfileIndex ).AllocLC() ; |
230 TPtrC swapProfileNamePtr( *swapProfileName ); |
233 } |
231 |
234 } |
232 HBufC* activateProfileString( StringLoader::LoadLC( |
235 |
233 R_AI_PERS_PROF_TOGGLE, swapProfileNamePtr ) ); |
236 if( swapProfileName ) |
234 |
237 { |
235 SetSwapProfileNameL( *activateProfileString ); |
238 HBufC* activateProfileString( StringLoader::LoadLC( |
236 |
239 R_AI_PERS_PROF_TOGGLE, swapProfileName->Des() ) ); |
237 CleanupStack::PopAndDestroy( 5 ); //profile, profileName, // profileNamesArray, swapProfileName, activateProfileString |
240 |
|
241 SetSwapProfileNameL( *activateProfileString ); |
|
242 |
|
243 CleanupStack::PopAndDestroy( 2 ); // swapProfileName, activateProfileString |
|
244 } |
|
245 |
|
246 CleanupStack::PopAndDestroy( 3 ); //profile, profileName, profileNamesArray, |
238 } |
247 } |
239 |
248 |
240 // ---------------------------------------------------------------------------- |
249 // ---------------------------------------------------------------------------- |
241 // CAiProfileEngine::ShowOfflineMessageL |
250 // CAiProfileEngine::ShowOfflineMessageL |
242 // |
251 // |