OSDN Git Service

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