ZIMA CAD Parts
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
datatransfer.h
Go to the documentation of this file.
1 #ifndef DATATRANSFER_H
2 #define DATATRANSFER_H
3 
4 #include <QObject>
5 #include <QNetworkReply>
6 
7 struct File;
8 
9 class DataTransfer : public QObject
10 {
11  Q_OBJECT
12 public:
13  explicit DataTransfer(QNetworkReply *src, File *dst, QObject *parent = 0);
14  ~DataTransfer();
15  bool initiate() const;
16  void setSource(QNetworkReply *src);
17  void setDeleteSrc(bool d);
18  void setDeleteDst(bool d);
19 
20 public slots:
21  void cancel();
22 
23 signals:
24  void progress(File *f);
25  void done(File *f);
26 
27 private slots:
28  void onReadingChannelClosed();
29  void onReadyRead();
30  void onMetadataChange();
31 
32 private:
33  QNetworkReply *src;
34  File *dst;
35  bool deleteSrc;
36  bool deleteDst;
37  bool canceled;
38 };
39 
40 #endif // DATATRANSFER_H
~DataTransfer()
Definition: datatransfer.cpp:16
void progress(File *f)
void cancel()
Definition: datatransfer.cpp:65
void setDeleteDst(bool d)
Definition: datatransfer.cpp:60
Definition: datatransfer.h:9
void setSource(QNetworkReply *src)
Definition: datatransfer.cpp:45
Definition: item.h:41
void done(File *f)
void setDeleteSrc(bool d)
Definition: datatransfer.cpp:55
bool initiate() const
Definition: datatransfer.cpp:30
DataTransfer(QNetworkReply *src, File *dst, QObject *parent=0)
Definition: datatransfer.cpp:6