-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcopythread.h
52 lines (41 loc) · 1.1 KB
/
copythread.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef COPYTHREAD_H
#define COPYTHREAD_H
#include <QtCore/qthread.h>
#include <QtCore/qdir.h>
#include <QDirIterator>
class CopyThread : public QThread {
Q_OBJECT
public:
inline CopyThread()
: dryRun(false)
, operation(Nothing)
{}
~CopyThread() Q_DEL_OVERRIDE;
enum OperationType {
Nothing,
CopyLibraries,
GetLinkList
};
inline void prepare(const QDir &source_,
const QString &target_,
bool dryRun_ = false) {
emit statusChanged("preparing");
source = source_;
m_target = target_;
dryRun = dryRun_;
}
inline void setOperation(OperationType ot) { operation = ot; }
inline QString target() const { return m_target; }
signals:
void domainChanged(const QString &status);
void statusChanged(const QString &status);
void listReady(const QStringList &links, const QStringList &localFiles);
protected:
void run() Q_DECL_OVERRIDE;
private:
QDir source;
QString m_target;
bool dryRun;
OperationType operation;
};
#endif // COPYTHREAD_H