homescreenpluginsrv/hspsmanager/src/hspsserverutil.cpp
changeset 1 844b978f8d5e
parent 0 79c6a41cd166
child 2 b7904b40483f
equal deleted inserted replaced
0:79c6a41cd166 1:844b978f8d5e
   564         RFs& aFs,
   564         RFs& aFs,
   565         CFileMan& aFilemanager,
   565         CFileMan& aFilemanager,
   566         const TPath& aTargetPath,
   566         const TPath& aTargetPath,
   567         const TFileName& aSourceFile )
   567         const TFileName& aSourceFile )
   568     {
   568     {
       
   569     // Construct target file with full path.
       
   570     TFileName targetFile;
       
   571     
       
   572     TParse targetParser;
       
   573     targetParser.Set( aTargetPath, NULL, NULL );    
       
   574     
       
   575     if( targetParser.NamePresent() )
       
   576         {
       
   577         targetFile = aTargetPath;
       
   578         }
       
   579     else
       
   580         {
       
   581         TParse sourceParser;
       
   582         sourceParser.Set( aSourceFile, NULL, NULL );
       
   583         targetFile = targetParser.DriveAndPath();
       
   584         targetFile.Append( sourceParser.NameAndExt() );    
       
   585         }
       
   586         
   569     // Make target folder
   587     // Make target folder
   570     TInt error = aFs.MkDirAll( aTargetPath );            
   588     TInt error = aFs.MkDirAll( aTargetPath );            
   571     if( error == KErrAlreadyExists )
   589     if( error == KErrAlreadyExists )
   572         {
   590         {
   573         // lets ignore error if directory already exists                
   591         // lets ignore error if directory already exists                
   579         error = KErrAlreadyExists;
   597         error = KErrAlreadyExists;
   580         
   598         
   581         // Check whether the resource needs to be copied
   599         // Check whether the resource needs to be copied
   582         if ( hspsServerUtil::ResourceCopyIsRelevantL( 
   600         if ( hspsServerUtil::ResourceCopyIsRelevantL( 
   583                 aSourceFile,
   601                 aSourceFile,
   584                 aTargetPath,
   602                 targetFile,
   585                 aFs ) 
   603                 aFs ) 
   586             )
   604             )
   587             {        
   605             {        
   588             // Slowish operation
   606             // Slowish operation
   589             error = aFilemanager.Copy( 
   607             error = aFilemanager.Copy(