MythTV  master
deletethread.h
Go to the documentation of this file.
1 #ifndef DELETETHREAD_H_
2 #define DELETETHREAD_H_
3 
4 // C++ headers
5 #include <cstdint>
6 #include <unistd.h>
7 
8 // Qt headers
9 #include <QMutex>
10 #include <QTimer>
11 #include <QDateTime>
12 #include <QStringList>
13 #include <QWaitCondition>
14 
15 // MythTV headers
16 #include "libmythbase/mthread.h"
18 
19 class DeleteThread : public QObject, public MThread
20 {
21  Q_OBJECT
22  public:
23  DeleteThread(void);
24  void run() override; // MThread
25  bool AddFile(const QString& path);
26  bool AddFile(DeleteHandler *handler);
27  void Stop(void) { m_run = false; }
28 
29  private:
30  void ProcessNew(void);
31  void ProcessOld(void);
32 
33  size_t m_increment { 9961472 };
34  bool m_slow;
35  bool m_link;
36  bool m_run { true };
37 
38  QList<DeleteHandler*> m_newfiles;
39  QMutex m_newlock;
40 
41  QList<DeleteHandler*> m_files;
42 };
43 
44 #endif
DeleteThread::AddFile
bool AddFile(const QString &path)
Definition: deletethread.cpp:69
DeleteThread
Definition: deletethread.h:19
DeleteThread::ProcessOld
void ProcessOld(void)
Definition: deletethread.cpp:214
fileserverutil.h
DeleteThread::m_newlock
QMutex m_newlock
Definition: deletethread.h:39
DeleteHandler
Definition: fileserverutil.h:17
DeleteThread::m_newfiles
QList< DeleteHandler * > m_newfiles
Definition: deletethread.h:38
DeleteThread::ProcessNew
void ProcessNew(void)
Definition: deletethread.cpp:90
DeleteThread::run
void run() override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
Definition: deletethread.cpp:35
DeleteThread::Stop
void Stop(void)
Definition: deletethread.h:27
DeleteThread::m_increment
size_t m_increment
Definition: deletethread.h:33
DeleteThread::m_link
bool m_link
Definition: deletethread.h:35
DeleteThread::DeleteThread
DeleteThread(void)
Definition: deletethread.cpp:28
MThread
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:48
mthread.h
DeleteThread::m_run
bool m_run
Definition: deletethread.h:36
DeleteThread::m_files
QList< DeleteHandler * > m_files
Definition: deletethread.h:41
DeleteThread::m_slow
bool m_slow
Definition: deletethread.h:34