100 |
96 |
101 bool FmBkupEnginePrivate::startBackup(QList<FmBkupDrivesAndOperation* > drivesAndOperationList, |
97 bool FmBkupEnginePrivate::startBackup(QList<FmBkupDrivesAndOperation* > drivesAndOperationList, |
102 QList<FmBkupBackupCategory*> backupCategoryList, |
98 QList<FmBkupBackupCategory*> backupCategoryList, |
103 QString drive, quint32 content) |
99 QString drive, quint32 content) |
104 { |
100 { |
|
101 if( drive.isEmpty() ) { |
|
102 iError = KErrPathNotFound; |
|
103 return false; |
|
104 } |
105 QString logString; |
105 QString logString; |
106 logString = "startBackup"; |
106 logString = "startBackup"; |
107 FmLogger::log( logString ); |
107 FmLogger::log( logString ); |
108 iDrvAndOpList->Reset(); |
108 iDrvAndOpList->Reset(); |
109 iBkupCategoryList->ResetAndDestroy(); |
109 iBkupCategoryList->ResetAndDestroy(); |
180 eikonEnv->SetSystem(ETrue); |
180 eikonEnv->SetSystem(ETrue); |
181 |
181 |
182 logString = "startBackup_StartOperationL"; |
182 logString = "startBackup_StartOperationL"; |
183 FmLogger::log( logString ); |
183 FmLogger::log( logString ); |
184 |
184 |
|
185 QList< FmRestoreInfo > restoreInfoList; |
|
186 TInt driveNumber = DriverNameToNumber( drive ); |
|
187 GetRestoreInfoArray( drivesAndOperationList, restoreInfoList, driveNumber ); |
|
188 |
|
189 for ( TInt i( 0 ); i < restoreInfoList.count(); i++ ) |
|
190 { |
|
191 bool toContinue = false; |
|
192 FmRestoreInfo &info = restoreInfoList[ i ]; |
|
193 TUint32 existContent( FmgrToBkupMask( info.content() ) ); |
|
194 if ( bkupContent & existContent ) |
|
195 { |
|
196 notifyBackupFilesExistInternal( toContinue ); |
|
197 if (!toContinue) |
|
198 { |
|
199 iError = KErrAlreadyExists; |
|
200 return false; |
|
201 } |
|
202 else |
|
203 { |
|
204 break; |
|
205 } |
|
206 } |
|
207 } |
|
208 |
|
209 |
185 TRAPD( err, iBkupEngine->StartOperationL( |
210 TRAPD( err, iBkupEngine->StartOperationL( |
186 EMMCScBkupOperationTypeFullBackup, *this, params ) ); |
211 EMMCScBkupOperationTypeFullBackup, *this, params ) ); |
187 |
212 |
188 logString = "startBackup_end with error:" + QString::number(err) ; |
213 logString = "startBackup_end with error:" + QString::number(err) ; |
189 FmLogger::log( logString ); |
214 FmLogger::log( logString ); |
275 void FmBkupEnginePrivate::notifyMemoryLowInternal( int memoryValue, int &userError ) |
300 void FmBkupEnginePrivate::notifyMemoryLowInternal( int memoryValue, int &userError ) |
276 { |
301 { |
277 emit notifyMemoryLow( memoryValue, userError ); |
302 emit notifyMemoryLow( memoryValue, userError ); |
278 } |
303 } |
279 |
304 |
|
305 void FmBkupEnginePrivate::notifyBackupFilesExistInternal( bool &isContinue ) |
|
306 { |
|
307 emit notifyBackupFilesExist( isContinue ); |
|
308 } |
|
309 |
280 TInt FmBkupEnginePrivate::HandleBkupEngineEventL( |
310 TInt FmBkupEnginePrivate::HandleBkupEngineEventL( |
281 MMMCScBkupEngineObserver::TEvent aEvent, TInt aAssociatedData ) |
311 MMMCScBkupEngineObserver::TEvent aEvent, TInt aAssociatedData ) |
282 { |
312 { |
283 QString logString; |
313 QString logString; |
284 TInt ret( KErrNone ); |
314 TInt ret( KErrNone ); |
725 QString FmBkupEnginePrivate::NumberToDriverName( TInt driver ) |
757 QString FmBkupEnginePrivate::NumberToDriverName( TInt driver ) |
726 { |
758 { |
727 QChar driverChar( driver - EDriveA + 'A' ); |
759 QChar driverChar( driver - EDriveA + 'A' ); |
728 QString driverName = QString( driverChar ) + ':'; |
760 QString driverName = QString( driverChar ) + ':'; |
729 return driverName; |
761 return driverName; |
|
762 } |
|
763 |
|
764 void FmBkupEnginePrivate::getBackupDriveList( QStringList &driveList ) |
|
765 { |
|
766 TUint32 driveAttMask( AllowedDriveAttMatchMask() ); |
|
767 RFs fs; |
|
768 fs.Connect(); |
|
769 for ( TInt i( 0 ); i < KMaxDrives; ++i ) |
|
770 { |
|
771 TDriveInfo driveInfo; |
|
772 if ( fs.Drive( driveInfo, i ) == KErrNone ) |
|
773 { |
|
774 // Do not allow backup for internal drives |
|
775 TUint driveStatus( 0 ); |
|
776 DriveInfo::GetDriveStatus( fs, i, driveStatus ); |
|
777 if ( driveStatus & DriveInfo::EDriveInternal ) |
|
778 { |
|
779 continue; |
|
780 } |
|
781 if ( driveInfo.iDriveAtt & driveAttMask ) |
|
782 { |
|
783 driveList.append( NumberToDriverName( i ) ); |
|
784 } |
|
785 } |
|
786 } |
|
787 |
|
788 fs.Close(); |
730 } |
789 } |
731 |
790 |
732 // ----------------------------------------------------------------------------- |
791 // ----------------------------------------------------------------------------- |
733 // CFileManagerEngine::PublishBurStatus() |
792 // CFileManagerEngine::PublishBurStatus() |
734 // |
793 // |