GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
ListedKeyServerTestTask.h
1 
29 #pragma once
30 
31 #include "GpgFrontendUI.h"
32 #include "core/thread/ThreadingModel.h"
33 
34 class QNetworkAccessManager;
35 class QNetworkReply;
36 
37 namespace GpgFrontend::UI {
38 
44  Q_OBJECT
45  public:
46  enum KeyServerTestResultType {
47  kTEST_RESULT_TYPE_SUCCESS,
48  kTEST_RESULT_TYPE_TIMEOUT,
49  kTEST_RESULT_TYPE_ERROR,
50  };
51 
52  explicit ListedKeyServerTestTask(QStringList urls, int timeout,
53  QWidget* parent = nullptr);
54 
59  auto Run() -> int override;
60 
61  signals:
68  std::vector<KeyServerTestResultType> result);
69 
70  private:
71  QStringList urls_;
72  std::vector<KeyServerTestResultType> result_;
73  QNetworkAccessManager* network_manager_;
74  int timeout_ = 500;
75  int result_count_ = 0;
76 
83  void slot_process_network_reply(int index, QNetworkReply* reply);
84 };
85 
86 } // namespace GpgFrontend::UI
87 
Definition: Task.h:39
Definition: ListedKeyServerTestTask.h:43
void SignalKeyServerListTestResult(std::vector< KeyServerTestResultType > result)
ListedKeyServerTestTask(QStringList urls, int timeout, QWidget *parent=nullptr)
Definition: ListedKeyServerTestTask.cpp:34
auto Run() -> int override
can be overwrite by subclass
Definition: ListedKeyServerTestTask.cpp:46
void slot_process_network_reply(int index, QNetworkReply *reply)
Definition: ListedKeyServerTestTask.cpp:76
Definition: ListedKeyServerTestTask.h:88
Definition: FileReadTask.cpp:31