ByteArrayViewProfileLockPrivate::ByteArrayViewProfileLockPrivate( const QString& fileName,
                                                                  const ByteArrayViewProfile::Id& id )
  : lockFile(fileName.isEmpty() ? fileName : viewProfileFileLockPath(fileName)),
    viewProfileId( id )
{
    if( not fileName.isEmpty() )
        lockFile.lock( KLockFile::NoBlockFlag | KLockFile::ForceFlag );
}
Пример #2
0
ByteArrayViewProfileLockPrivate::ByteArrayViewProfileLockPrivate( const QString& fileName,
                                                                  const ByteArrayViewProfile::Id& id )
  : lockFile(new QLockFile(fileName.isEmpty() ? fileName : viewProfileFileLockPath(fileName))),
    viewProfileId( id )
{
    if( !fileName.isEmpty() )
    {
        if ( !lockFile->tryLock( 1000 ) )
            qCWarning(LOG_KASTEN_OKTETA_GUI) << "Failed to acquire lock file" << fileName
                    << "error =" << lockFile->error();
    }
}