Logo Search packages:      
Sourcecode: ultracopier version File versions  Download package

bool copyThread::tryOpenFileInSpecialMode ( QFile *  theFile,
QIODevice::OpenMode  theModeShouldBeUsed 
) [private]

try open file in special mode

Parameters:
theFilePointer on the file
theModeShouldBeUsedWich mode should be used

Definition at line 864 of file CopyThread.cpp.

Referenced by run().

{
      //if file is already open
      if(theFile->isOpen())
      {
            DEBUGCONSOLE(50,"copyThread::tryOpenFileInSpecialMode","already open");
            //check the open mode
            if(theFile->openMode()!=theModeShouldBeUsed)
            {
                  theFile->close();
                  return theFile->open(theModeShouldBeUsed);
            }
            else
                  return true;
      }
      else
      {
            #if (DEBUG_ULTRACOPIER>0)
            if(theModeShouldBeUsed==QIODevice::WriteOnly)
                  DEBUGCONSOLE(90,"copyThread::tryOpenFileInSpecialMode","file: "+theFile->fileName()+", QIODevice::WriteOnly");
            else
                  DEBUGCONSOLE(90,"copyThread::tryOpenFileInSpecialMode","file: "+theFile->fileName()+", not QIODevice::WriteOnly");
            #endif
            return theFile->open(theModeShouldBeUsed);
      }
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index