diff -r 12b82dc0e8db -r 81668a704644 filemanager/src/fmbkupenginewrapper/private/symbian/fmbkupengine_p.cpp --- a/filemanager/src/fmbkupenginewrapper/private/symbian/fmbkupengine_p.cpp Thu Sep 30 16:33:59 2010 +0800 +++ b/filemanager/src/fmbkupenginewrapper/private/symbian/fmbkupengine_p.cpp Mon Oct 18 09:44:31 2010 +0800 @@ -94,7 +94,19 @@ return ret; } -bool FmBkupEnginePrivate::startBackup(QList drivesAndOperationList, +/* + * wrap up startBackupL as a unleave function + */ +bool FmBkupEnginePrivate::startBackup( QList drivesAndOperationList, + QList backupCategoryList, + QString drive, quint32 content) +{ + TBool ret( EFalse ); + TRAP_IGNORE( ret = startBackupL( drivesAndOperationList, backupCategoryList, drive, content ) ); + return ret; +} + +bool FmBkupEnginePrivate::startBackupL(QList drivesAndOperationList, QList backupCategoryList, QString drive, quint32 content) { @@ -137,8 +149,7 @@ for( QList::iterator it = backupCategoryList.begin(); it != backupCategoryList.end(); ++it ) { FmBkupBackupCategory* fmbkupCategory = *it; - CBkupCategory* category = CBkupCategory::NewL(); - + CBkupCategory* category = CBkupCategory::NewLC(); category->setCategory( fmbkupCategory->category() ); HBufC *archiveName = HBufC::NewL( fmbkupCategory->archive_name().length() ); @@ -164,6 +175,7 @@ iBkupCategoryList->AppendL( category ); + CleanupStack::Pop();//category } TUint32 bkupContent( FmgrToBkupMask( content ) ); @@ -442,17 +454,23 @@ } } - - +/* + * wrap up leave function deleteBackupL. + */ +int FmBkupEnginePrivate::deleteBackup( QList drivesAndOperationList ) +{ + TInt err( KErrNone ); + TRAP_IGNORE( err = deleteBackupL( drivesAndOperationList) ); + return err; +} - -int FmBkupEnginePrivate::deleteBackup( QList drivesAndOperationList ) +int FmBkupEnginePrivate::deleteBackupL( QList drivesAndOperationList ) { iError = FmErrNone; QList< FmRestoreInfo > selection; - FmRestoreSettings& rstSettings( *( q->RestoreSettingsL() ) ); - rstSettings.GetSelectionL( selection ); + FmRestoreSettings& rstSettings( *( q->RestoreSettings() ) ); + rstSettings.GetSelection( selection ); iBkupCategoryList->ResetAndDestroy(); for( QList::iterator it = drivesAndOperationList.begin(); @@ -526,8 +544,17 @@ return iError; } +/* + * wrap up startRestoreL as a unleave function + */ +bool FmBkupEnginePrivate::startRestore( QList drivesAndOperationList ) +{ + TBool ret( EFalse ); + TRAP_IGNORE( ret = startRestoreL( drivesAndOperationList ) ); + return ret; +} -bool FmBkupEnginePrivate::StartRestoreL( QList drivesAndOperationList ) +bool FmBkupEnginePrivate::startRestoreL( QList drivesAndOperationList ) { TBool diskFull( SysUtil::DiskSpaceBelowCriticalLevelL( &iFs, 0, KFmgrSystemDrive ) ); @@ -579,8 +606,8 @@ // Get user set restore selection QList< FmRestoreInfo > selection; // CleanupClosePushL( selection ); - FmRestoreSettings& rstSettings( *( q->RestoreSettingsL() ) ); - rstSettings.GetSelectionL( selection ); + FmRestoreSettings& rstSettings( *( q->RestoreSettings() ) ); + rstSettings.GetSelection( selection ); // Remove non user selected archives TInt i( 0 ); @@ -632,7 +659,7 @@ CMMCScBkupOpParamsRestoreFull::NewL( driveReader, EBUCatAllInOne ); CleanupStack::PopAndDestroy(); // driveReader - FmBackupSettings& bkupSettings( *( q->BackupSettingsL() ) ); + FmBackupSettings& bkupSettings( *( q->BackupSettings() ) ); // Get list of all archives RPointerArray< CMMCScBkupArchiveInfo > archives; TCleanupItem cleanupItem( ResetAndDestroyArchives, &archives );