homescreenpluginsrv/hspsmanager/src/hspsserverutil.cpp
branchRCL_3
changeset 12 502e5d91ad42
parent 3 ff572005ac23
child 14 15e4dd19031c
equal deleted inserted replaced
11:bd874ee5e5e2 12:502e5d91ad42
  1840         node = iter->NextL();
  1840         node = iter->NextL();
  1841         }   
  1841         }   
  1842     CleanupStack::PopAndDestroy( iter );
  1842     CleanupStack::PopAndDestroy( iter );
  1843     return targetNode;
  1843     return targetNode;
  1844     } 
  1844     } 
       
  1845 
       
  1846 
       
  1847 // -----------------------------------------------------------------------------
       
  1848  // hspsServerUtil::FindFile
       
  1849  // Eclipsing support for customization 
       
  1850  // -----------------------------------------------------------------------------
       
  1851  //
       
  1852  TInt hspsServerUtil::FindFile(
       
  1853          RFs& aFs,
       
  1854          const TDesC& aPath,
       
  1855          const TDesC& aFilename,         
       
  1856          TFileName& aDrivePathName )
       
  1857      {   
       
  1858      TInt err = KErrNotFound;
       
  1859      
       
  1860      TParsePtrC parser( aPath );
       
  1861      const TPath path = parser.Path();
       
  1862           
       
  1863      TFileName filename( aFilename );         
       
  1864      if( filename.Length() == 0 )
       
  1865          {
       
  1866          filename.Copy( parser.NameAndExt() );
       
  1867          }
       
  1868      
       
  1869      if( filename.Length() > 0 && path.Length() > 0 )
       
  1870          {              
       
  1871          // Find the input file, search from the user area (UDA) first, 
       
  1872          // exclude external/remote drives from the search - otherwise end-users  
       
  1873          // could introduce fixed configurations (e.g. operator locks wouldn't work)
       
  1874          TFindFile fileFinder( aFs );
       
  1875          fileFinder.SetFindMask( 
       
  1876              KDriveAttExclude|KDriveAttRemovable|KDriveAttRemote|KDriveAttSubsted );
       
  1877          aFs.SetSessionToPrivate( EDriveE );
       
  1878          err = fileFinder.FindByDir( filename, path );
       
  1879          aFs.SetSessionToPrivate( EDriveC );     
       
  1880          if( !err )          
       
  1881              {         
       
  1882              // Return the path with a drive reference 
       
  1883              aDrivePathName = fileFinder.File();        
       
  1884              TParsePtrC drvParser( aDrivePathName );
       
  1885              if( !drvParser.DrivePresent() )
       
  1886                  {             
       
  1887                  err = KErrNotFound;
       
  1888                  }
       
  1889              }
       
  1890          }
       
  1891               
       
  1892      return err;
       
  1893      }
       
  1894 
  1845 // -----------------------------------------------------------------------------
  1895 // -----------------------------------------------------------------------------
  1846 // hspsServerUtil::hspsServerUtil
  1896 // hspsServerUtil::hspsServerUtil
  1847 // -----------------------------------------------------------------------------
  1897 // -----------------------------------------------------------------------------
  1848 //
  1898 //
  1849 hspsServerUtil::hspsServerUtil() 
  1899 hspsServerUtil::hspsServerUtil()