213 } |
213 } |
214 |
214 |
215 |
215 |
216 void CMemSpyViewThreadInfoItemGeneric::SetListBoxModelL() |
216 void CMemSpyViewThreadInfoItemGeneric::SetListBoxModelL() |
217 { |
217 { |
218 iMemSpySession.GetThreadInfoItems( iThreadInfoItems, iThreadId, iType ); // TODO don't ignore error! |
218 |
|
219 RArray<CMemSpyApiThreadInfoItem*> threadInfoItems; |
|
220 iMemSpySession.GetThreadInfoItems( threadInfoItems, iThreadId, iType ); // TODO don't ignore error! |
|
221 CleanupClosePushL( threadInfoItems ); |
219 |
222 |
220 iModel = new (ELeave) CDesC16ArrayFlat( iThreadInfoItems.Count() + 10 ); |
223 CDesCArrayFlat* model = new (ELeave) CDesC16ArrayFlat( threadInfoItems.Count() + 10 ); |
|
224 CleanupStack::PushL( model ); |
221 |
225 |
222 for( TInt i=0; i<iThreadInfoItems.Count(); i++) |
226 for( TInt i=0; i<threadInfoItems.Count(); i++) |
223 { |
227 { |
224 HBufC* combined = HBufC::NewLC( iThreadInfoItems[i]->Caption().Length() + iThreadInfoItems[i]->Value().Length() + 30 ); |
228 HBufC* combined = HBufC::NewLC( threadInfoItems[i]->Caption().Length() + threadInfoItems[i]->Value().Length() + 30 ); |
225 |
229 |
226 TPtr pCombined( combined->Des() ); |
230 TPtr pCombined( combined->Des() ); |
227 pCombined.Zero(); |
231 pCombined.Zero(); |
228 pCombined.Copy( _L("\t") ); |
232 pCombined.Copy( _L("\t") ); |
229 if( iThreadInfoItems[i]->Caption() != KNullDesC ) |
233 if( threadInfoItems[i]->Caption() != KNullDesC ) |
230 pCombined.Append( iThreadInfoItems[i]->Caption() ); |
234 pCombined.Append( threadInfoItems[i]->Caption() ); |
231 if( iType != EMemSpyThreadInfoItemTypeChunk ) |
235 if( iType != EMemSpyThreadInfoItemTypeChunk ) |
232 { |
236 { |
233 pCombined.Append( _L("\t\t") ); |
237 pCombined.Append( _L("\t\t") ); |
234 pCombined.Append( iThreadInfoItems[i]->Value() ); |
238 pCombined.Append( threadInfoItems[i]->Value() ); |
235 } |
239 } |
236 |
240 |
237 iModel->AppendL( pCombined ); |
241 model->AppendL( pCombined ); |
238 |
242 |
239 CleanupStack::PopAndDestroy(combined); |
243 CleanupStack::PopAndDestroy( combined ); |
240 } |
244 } |
241 |
245 |
242 CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox ); |
246 CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox ); |
243 //listbox->Model()->SetItemTextArray( iInfoItem ); |
247 //listbox->Model()->SetItemTextArray( iInfoItem ); |
244 listbox->Model()->SetItemTextArray( iModel ); |
248 listbox->Model()->SetItemTextArray( model ); |
245 listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); |
249 listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); |
|
250 |
|
251 CleanupStack::Pop( model ); |
|
252 CleanupStack::PopAndDestroy( &threadInfoItems ); |
246 } |
253 } |
247 |
254 |
248 |
255 |
249 void CMemSpyViewThreadInfoItemGeneric::HandleListBoxItemActionedL( TInt /*aIndex*/ ) |
256 void CMemSpyViewThreadInfoItemGeneric::HandleListBoxItemActionedL( TInt /*aIndex*/ ) |
250 { |
257 { |