TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
ttklockedfile.cpp
Go to the documentation of this file.
1 #include "ttklockedfile.h"
2 
3 TTKLockedFile::TTKLockedFile()
4  : QFile()
5 {
6 #ifdef Q_OS_WIN
7  m_wmutex = 0;
8  m_rmutex = 0;
9 #endif
10  m_lock_mode = NoLock;
11 }
12 
13 TTKLockedFile::TTKLockedFile(const QString &name)
14  : QFile(name)
15 {
16 #ifdef Q_OS_WIN
17  m_wmutex = 0;
18  m_rmutex = 0;
19 #endif
20  m_lock_mode = NoLock;
21 }
22 
23 bool TTKLockedFile::open(OpenMode mode)
24 {
25  if (mode & QIODevice::Truncate) {
26  qWarning("TTKLockedFile::open(): Truncate mode not allowed.");
27  return false;
28  }
29  return QFile::open(mode);
30 }
31 
32 bool TTKLockedFile::isLocked() const
33 {
34  return m_lock_mode != NoLock;
35 }
36 
37 TTKLockedFile::LockMode TTKLockedFile::lockMode() const
38 {
39  return m_lock_mode;
40 }
const char * name
Definition: http_parser.c:458
const char int mode
Definition: ioapi.h:135