comparison main/Surveyer.h @ 2535:62b1a3a242ee

Towards reusing the survey logic for a request for info & guidance
author Chris Cannam
date Tue, 12 May 2020 17:41:54 +0100
parents 55efa5a18814
children
comparison
equal deleted inserted replaced
2534:0dec5e47dd8f 2535:62b1a3a242ee
25 class Surveyer : public QObject 25 class Surveyer : public QObject
26 { 26 {
27 Q_OBJECT 27 Q_OBJECT
28 28
29 public: 29 public:
30 Surveyer(QString hostname, QString testPath, QString surveyPath); 30 struct Config {
31 QString hostname;
32 QString testPath;
33 QString surveyPath;
34 QString countdownKey;
35 int countdownFrom;
36 QString title;
37 QString text;
38 QString acceptLabel;
39 QString rejectLabel;
40 bool includeSystemInfo;
41 };
42
43 Surveyer(Config config);
31 virtual ~Surveyer(); 44 virtual ~Surveyer();
32 45
33 protected slots: 46 protected slots:
34 void finished(); 47 void finished();
35 void error(QNetworkReply::NetworkError); 48 void error(QNetworkReply::NetworkError);
36 49
37 private: 50 private:
51 Config m_config;
38 bool m_httpFailed; 52 bool m_httpFailed;
39 QString m_hostname;
40 QString m_testPath;
41 QString m_surveyPath;
42 QNetworkReply *m_reply; 53 QNetworkReply *m_reply;
43 QNetworkAccessManager *m_nm; 54 QNetworkAccessManager *m_nm;
44 }; 55 };
45 56
46 #endif 57 #endif