17 */ |
17 */ |
18 |
18 |
19 #ifndef FMOPERATIONTHREAD_H |
19 #ifndef FMOPERATIONTHREAD_H |
20 #define FMOPERATIONTHREAD_H |
20 #define FMOPERATIONTHREAD_H |
21 |
21 |
22 #include "fmoperationservice.h" |
22 #include "fmoperationbase.h" |
23 #include "fmcommon.h" |
23 #include "fmcommon.h" |
24 |
24 |
25 #include <QString> |
25 #include <QString> |
26 #include <QStringList> |
26 #include <QStringList> |
27 |
27 |
28 #include <QThread> |
28 #include <QThread> |
29 |
29 |
30 class FmDriveDetailsSize; |
|
31 class FmOperationBase; |
|
32 |
|
33 class FmOperationCopy; |
|
34 class FmOperationMove; |
|
35 class FmOperationRemove; |
|
36 |
|
37 class FmOperationThread : public QThread |
30 class FmOperationThread : public QThread |
38 { |
31 { |
39 Q_OBJECT |
32 Q_OBJECT |
40 public: |
33 public: |
41 FmOperationThread( QObject *parent ); |
34 FmOperationThread( QObject *parent ); |
42 ~FmOperationThread(); |
35 ~FmOperationThread(); |
43 |
36 int prepareOperationAndStart( FmOperationBase* operationBase ); |
44 int asyncCopy( FmOperationBase* operationBase ); |
37 void stop(); |
45 int asyncMove( FmOperationBase *operationBase ); |
|
46 int asyncRemove( FmOperationBase *operationBase ); |
|
47 |
|
48 int asyncFormat( FmOperationBase *operationBase ); |
|
49 int asyncViewDriveDetails( FmOperationBase *operationBase ); |
|
50 int asyncViewFolderDetails( FmOperationBase *operationBase ); |
|
51 void stop(); |
|
52 |
|
53 signals: |
|
54 void askForRename( const QString &srcFile, QString *destFile ); |
|
55 void askForReplace( const QString &srcFile, const QString &destFile, bool *isAccepted ); |
|
56 void refreshModel( const QString &path ); |
|
57 |
|
58 void notifyWaiting( bool cancelable ); |
|
59 void notifyPreparing( bool cancelable ); // this step could not be used if not needed. |
|
60 void notifyStart( bool cancelable, int maxSteps ); |
|
61 void notifyProgress( int currentStep ); |
|
62 |
|
63 void notifyFinish(); |
|
64 void notifyError(int error, QString errString ); |
|
65 void notifyCanceled(); |
|
66 |
|
67 private slots: |
|
68 void onAskForRename( const QString &srcFile, QString *destFile ); |
|
69 void onAskForReplace( const QString &srcFile, const QString &destFile, bool *isAccepted ); |
|
70 void on_operationElement_notifyPreparing( bool cancelable ); |
|
71 void on_operationElement_notifyStart( bool cancelable, int maxSteps ); |
|
72 void on_operationElement_notifyProgress( int currentStep ); |
|
73 |
38 |
74 protected: |
39 protected: |
75 void run(); |
40 void run(); |
76 |
41 |
77 private: |
42 private: |