qthighway/xqserviceutil/src/xqsharablefile.cpp
changeset 4 90517678cc4f
parent 1 2b40d63a9c3d
child 5 453da2cfceef
equal deleted inserted replaced
1:2b40d63a9c3d 4:90517678cc4f
    89 }
    89 }
    90 
    90 
    91 bool XQSharableFile::open(const QString &fileName)
    91 bool XQSharableFile::open(const QString &fileName)
    92 {
    92 {
    93     close();   // Close possibly existing old one
    93     close();   // Close possibly existing old one
    94         
    94 
       
    95     QString symbianFileName = fileName;
       
    96     symbianFileName.replace("/", "\\");
       
    97     
    95     TInt err = mSharableFS.Connect();
    98     TInt err = mSharableFS.Connect();
    96     if (err != KErrNone)
    99     if (err != KErrNone)
    97     {
   100     {
    98         return false;
   101         return false;
    99     }
   102     }
   100     
   103     
   101     mSharableFS.ShareProtected();
   104     mSharableFS.ShareProtected();
   102     TPtrC name( reinterpret_cast<const TUint16*>(fileName.utf16()));
   105     TPtrC name( reinterpret_cast<const TUint16*>(symbianFileName.utf16()));
   103     RFile f;
   106     RFile f;
   104     err = f.Open(mSharableFS, name, EFileShareReadersOnly);
   107     err = f.Open(mSharableFS, name, EFileShareReadersOnly);
   105     if (err != KErrNone)
   108     if (err != KErrNone)
   106     {
   109     {
   107         // Error in opening, close the created session
   110         // Error in opening, close the created session