1 /* |
1 /* |
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of the License "Eclipse Public License v1.0" |
5 * under the terms of the License "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
447 |
448 |
448 //Connect to the database |
449 //Connect to the database |
449 upsDb = CDecisionDbW::NewL(iDbLocation,iFs); |
450 upsDb = CDecisionDbW::NewL(iDbLocation,iFs); |
450 CleanupStack::PushL(upsDb); |
451 CleanupStack::PushL(upsDb); |
451 |
452 |
452 RPointerArray<CDecisionRecord> recordList = GetDecisionsL(*upsDb,*filter,iCancel); |
453 RPointerArray<CDecisionRecord> recordList; |
|
454 CleanupResetAndDestroyPushL(recordList); |
|
455 GetDecisionsL(*upsDb, *filter, iCancel, recordList); |
453 |
456 |
454 TInt recNum; |
457 TInt recNum; |
455 recNum = recordList.Count(); |
458 recNum = recordList.Count(); |
456 if(recNum) |
459 if(recNum) |
457 { |
460 { |
458 CleanupClosePushL(recordList); |
|
459 OpenDecisionFileL(EFileWrite); |
461 OpenDecisionFileL(EFileWrite); |
460 |
462 |
461 for(TInt i=0; i<recNum; ++i) |
463 for(TInt i=0; i<recNum; ++i) |
462 { |
464 { |
463 WriteDecisionL(*recordList[i]); |
465 WriteDecisionL(*recordList[i]); |
464 } |
466 } |
465 CloseDecisionFile(); |
467 CloseDecisionFile(); |
466 CleanupStack::Pop(&recordList); |
468 } |
467 } |
469 CleanupStack::PopAndDestroy(&recordList); |
468 recordList.Close(); |
|
469 |
470 |
470 TInt expectedRecords; |
471 TInt expectedRecords; |
471 if(EFalse == GetIntFromConfig(ConfigSection(),KExpectedRecords,expectedRecords)) |
472 if(EFalse == GetIntFromConfig(ConfigSection(),KExpectedRecords,expectedRecords)) |
472 { |
473 { |
473 expectedRecords=-1; |
474 expectedRecords=-1; |