GpgFrontend Project A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.

ListedKeyServerTestTask.h
1
27 #ifndef GPGFRONTEND_LISTEDKEYSERVERTESTTHREAD_H
28 #define GPGFRONTEND_LISTEDKEYSERVERTESTTHREAD_H
29
30 #include "GpgFrontendUI.h"
31 namespace GpgFrontend::UI {
32
37 class ListedKeyServerTestTask : public Thread::Task {
38 Q_OBJECT
39 public:
40 enum KeyServerTestResultType {
41 kTestResultType_Success,
42 kTestResultType_Timeout,
43 kTestResultType_Error,
44 };
45
46 explicit ListedKeyServerTestTask(const QStringList& urls, int timeout,
47 QWidget* parent = nullptr);
48
49 signals:
55 void SignalKeyServerListTestResult(
56 std::vector<KeyServerTestResultType> result);
57
58 protected:
63 void run() override;
64
65 private:
66 QStringList urls_;
67 std::vector<KeyServerTestResultType> result_;
68 QNetworkAccessManager* network_manager_;
69 int timeout_ = 500;
70 int result_count_ = 0;
71
78 void slot_process_network_reply(int index, QNetworkReply* reply);
79 };
80
81 } // namespace GpgFrontend::UI
82
83 class TestListedKeyServerThread {};
84
85 #endif // GPGFRONTEND_LISTEDKEYSERVERTESTTHREAD_H
GpgFrontend::Thread::Task
Definition: Task.h:45
GpgFrontend::UI::ListedKeyServerTestTask
Definition: ListedKeyServerTestTask.h:37
GpgFrontend::UI::ListedKeyServerTestTask::SignalKeyServerListTestResult
void SignalKeyServerListTestResult(std::vector< KeyServerTestResultType > result)
GpgFrontend::UI::ListedKeyServerTestTask::ListedKeyServerTestTask
ListedKeyServerTestTask(const QStringList &urls, int timeout, QWidget *parent=nullptr)
Definition: ListedKeyServerTestTask.cpp:31
GpgFrontend::UI::ListedKeyServerTestTask::slot_process_network_reply
void slot_process_network_reply(int index, QNetworkReply *reply)
Definition: ListedKeyServerTestTask.cpp:74
TestListedKeyServerThread
Definition: ListedKeyServerTestTask.h:83
GpgFrontend::UI
Definition: FileReadTask.cpp:29