202 { |
202 { |
203 TInt count = aReferences.Count(); |
203 TInt count = aReferences.Count(); |
204 PRINT2( _L("MM MTP => CGetObjectReferences::AddReferencesL aRefOwnerSuid = %S, ref count = %d"), &aRefOwnerSuid, count ); |
204 PRINT2( _L("MM MTP => CGetObjectReferences::AddReferencesL aRefOwnerSuid = %S, ref count = %d"), &aRefOwnerSuid, count ); |
205 |
205 |
206 // check if references are valid |
206 // check if references are valid |
207 for ( TInt i = count-1; i >= 0; i-- ) |
207 TInt removeCount = 0; |
208 { |
208 for ( TInt i = 0; i < count; i++ ) |
209 TPtrC temp( aReferences[i] ); |
209 { |
210 PRINT2( _L( "MM MTP <> CGetObjectReferences::AddReferencesL ref[%d]'s name = %S" ), i, &temp ); |
210 TInt index = i - removeCount; |
|
211 TPtrC temp( aReferences[index] ); |
|
212 PRINT2( _L( "MM MTP <> CGetObjectReferences::AddReferencesL ref[%d]'s name = %S" ), index, &temp ); |
211 PERFLOGSTART( KObjectManagerHandle ); |
213 PERFLOGSTART( KObjectManagerHandle ); |
212 TUint32 handle = iFramework.ObjectMgr().HandleL( temp ); |
214 TUint32 handle = iFramework.ObjectMgr().HandleL( temp ); |
213 PERFLOGSTOP( KObjectManagerHandle ); |
215 PERFLOGSTOP( KObjectManagerHandle ); |
214 if ( handle == KMTPHandleNone ) // object doesn't exist |
216 if ( handle == KMTPHandleNone ) // object doesn't exist |
215 { |
217 { |
216 PRINT1( _L( "MM MTP <> CGetObjectReferences::AddReferencesL, [%S] doesn't existed in handle db, remove this from reference array" ), &temp ); |
218 PRINT1( _L( "MM MTP <> CGetObjectReferences::AddReferencesL, [%S] doesn't existed in handle db, remove this from reference array" ), &temp ); |
217 |
219 |
218 // if handle is invalid, remove from reference array |
220 // if handle is invalid, remove from reference array |
219 aReferences.Delete( i ); |
221 aReferences.Delete( index, 1 ); |
|
222 removeCount++; |
220 } |
223 } |
221 } |
224 } |
222 |
225 |
223 // add all references into references db |
226 // add all references into references db |
224 MMTPReferenceMgr& referenceMgr = iFramework.ReferenceMgr(); |
227 MMTPReferenceMgr& referenceMgr = iFramework.ReferenceMgr(); |