-
Notifications
You must be signed in to change notification settings - Fork 1
/
syncer.h
80 lines (64 loc) · 2.13 KB
/
syncer.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef SYNCER_H
#define SYNCER_H
#include <QObject>
#include <QString>
#include <3rdparty/qftp/qurlinfo.h>
class QFtp;
class FolderInfo;
class QBuffer;
class Syncer : public QObject
{
Q_OBJECT
Q_PROPERTY(QString dataFileName READ dataFileName WRITE setDataFileName NOTIFY dataFileNameChanged)
Q_PROPERTY(QString folderPath READ folderPath WRITE setFolderPath NOTIFY folderPathChanged)
Q_PROPERTY(QString host READ host WRITE setHost NOTIFY hostChanged)
Q_PROPERTY(QString username READ username WRITE setUsername NOTIFY usernameChanged)
Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged)
Q_PROPERTY(quint16 port READ port WRITE setPort NOTIFY portChanged)
QString m_dataFileName;
QString m_folderPath;
QString m_host;
QString m_username;
QString m_password;
quint16 m_port;
QFtp *ftp;
QBuffer *remoteHashBuffer;
bool listFoundOnServer;
FolderInfo *remoteList;
FolderInfo *localList;
void downloadList();
void compair();
public:
Syncer(QObject *parent = Q_NULLPTR);
~Syncer();
void start();
QString dataFileName() const;
QString folderPath() const;
QString host() const;
QString username() const;
QString password() const;
quint16 port() const;
public slots:
void setDataFileName(QString dataFileName);
void setFolderPath(QString folderPath);
void setHost(QString host);
void setUsername(QString username);
void setPassword(QString password);
void setPort(quint16 port);
void on_ftp_stateChanged(int);
void on_ftp_listInfo(const QUrlInfo&);
void on_ftp_dataTransferProgress(qint64, qint64);
void on_ftp_rawCommandReply(int, const QString&);
void on_ftp_commandStarted(int);
void on_ftp_commandFinished(int, bool);
void on_ftp_done(bool);
signals:
void log(const QString &status);
void dataFileNameChanged(QString dataFileName);
void folderPathChanged(QString folderPath);
void hostChanged(QString host);
void usernameChanged(QString username);
void passwordChanged(QString password);
void portChanged(quint16 port);
};
#endif // SYNCER_H