filemanager/src/fmbkupenginewrapper/private/symbian/fmbkupengine_p.cpp
changeset 49 81668a704644
parent 33 328cf6fbe40c
--- 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<FmBkupDrivesAndOperation* > drivesAndOperationList,
+/*
+ * wrap up startBackupL as a unleave function
+ */
+bool FmBkupEnginePrivate::startBackup( QList<FmBkupDrivesAndOperation* > drivesAndOperationList,
+    QList<FmBkupBackupCategory*> backupCategoryList,
+    QString drive, quint32 content)
+{
+    TBool ret( EFalse );
+    TRAP_IGNORE( ret = startBackupL( drivesAndOperationList, backupCategoryList, drive, content ) );
+    return ret;
+}
+
+bool FmBkupEnginePrivate::startBackupL(QList<FmBkupDrivesAndOperation* > drivesAndOperationList,
 	    QList<FmBkupBackupCategory*> backupCategoryList,
 	    QString drive, quint32 content)
 {
@@ -137,8 +149,7 @@
 	for( QList<FmBkupBackupCategory* >::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<FmBkupDrivesAndOperation* > drivesAndOperationList )
+{
+    TInt err( KErrNone );
+    TRAP_IGNORE( err = deleteBackupL( drivesAndOperationList) );
+    return err;
+}
 
-
-int FmBkupEnginePrivate::deleteBackup( QList<FmBkupDrivesAndOperation* > drivesAndOperationList )
+int FmBkupEnginePrivate::deleteBackupL( QList<FmBkupDrivesAndOperation* > drivesAndOperationList )
 {
     iError = FmErrNone;
 
     QList< FmRestoreInfo > selection;
-    FmRestoreSettings& rstSettings( *( q->RestoreSettingsL() ) );
-    rstSettings.GetSelectionL( selection );
+    FmRestoreSettings& rstSettings( *( q->RestoreSettings() ) );
+    rstSettings.GetSelection( selection );
 
     iBkupCategoryList->ResetAndDestroy();
     for( QList<FmBkupDrivesAndOperation* >::iterator it = drivesAndOperationList.begin();
@@ -526,8 +544,17 @@
     return iError;
 }
 
+/*
+ * wrap up startRestoreL as a unleave function
+ */
+bool FmBkupEnginePrivate::startRestore( QList<FmBkupDrivesAndOperation* > drivesAndOperationList )
+{
+    TBool ret( EFalse );
+    TRAP_IGNORE( ret = startRestoreL( drivesAndOperationList ) );
+    return ret;
+}
 
-bool FmBkupEnginePrivate::StartRestoreL( QList<FmBkupDrivesAndOperation* > drivesAndOperationList )
+bool FmBkupEnginePrivate::startRestoreL( QList<FmBkupDrivesAndOperation* > 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 );