OSDN Git Service

Ver0.21
[gefu/Gefu.git] / copymoveworker.h
1 #ifndef COPYWORKER_H\r
2 #define COPYWORKER_H\r
3 \r
4 #include "abstractworker.h"\r
5 #include "global.h"\r
6 \r
7 #include <QFileInfo>\r
8 \r
9 class CopyMoveWorker : public AbstractWorker\r
10 {\r
11     Q_OBJECT\r
12 public:\r
13     explicit CopyMoveWorker(QObject *parent = 0);\r
14 \r
15     void setCopyList(const QFileInfoList *list) {\r
16         m_CopyList = list;\r
17     }\r
18     void setTargetDir(const QString &path) {\r
19         m_tgtDir = path;\r
20     }\r
21     void setMoveMode(bool move) {\r
22         m_Move = move;\r
23     }\r
24 \r
25     void endAsking() {\r
26         QMutexLocker lock(&m_AskingMutex);\r
27         m_Asking = false;\r
28     }\r
29 \r
30 signals:\r
31     void askOverWrite(QString *copyMethod, QString *alias,\r
32                       const QString &srcPath, const QString &tgtPath);\r
33 \r
34 public slots:\r
35     void operate();\r
36 \r
37 private:\r
38     const QFileInfoList *m_CopyList;\r
39     QString m_tgtDir;\r
40     StringMap m_CopyMap;\r
41     QMutex m_AskingMutex;\r
42     bool m_Asking;\r
43     bool m_Move;\r
44 \r
45     bool isAsking() {\r
46         QMutexLocker lock(&m_AskingMutex);\r
47         return m_Asking;\r
48     }\r
49 \r
50     void Listup(const QString &srcPath, const QString &tgtPath);\r
51 };\r
52 \r
53 #endif // COPYWORKER_H\r