-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathworker.h
45 lines (37 loc) · 1.19 KB
/
worker.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
#ifndef WORKER_H
#define WORKER_H
#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QAuthenticator>
#include <QUrl>
#include <QtCore>
//QFileSystemWatcher * watcher;
class Worker : public QObject
{
Q_OBJECT
public:
explicit Worker(QObject *parent = nullptr);
~Worker();
signals:
public slots:
void get(QString location);
void post(QString location, QByteArray data);
bool UpdateFileTimestamp(std::string fileName);
void fileChangedEvent(const QString & path);
QJsonDocument ReadJson(const QString &path);
void run();
private slots:
void readyRead();
void authenticationRequired(QNetworkReply *reply, QAuthenticator *authenticator);
void encrypted(QNetworkReply *reply);
void finished(QNetworkReply *reply);
void preSharedKeyAuthenticationRequired(QNetworkReply *reply, QSslPreSharedKeyAuthenticator *authenticator);
void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator);
void sslErrors(QNetworkReply *reply, const QList<QSslError> &errors);
private:
QNetworkAccessManager manager;
QFileSystemWatcher * watcher;
};
#endif // WORKER_H