GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
VersionCheckTask.h
1 
29 #ifndef GPGFRONTEND_VERSIONCHECKTHREAD_H
30 #define GPGFRONTEND_VERSIONCHECKTHREAD_H
31 
32 #include <memory>
33 #include <string>
34 
35 #include "core/thread/Task.h"
36 #include "ui/GpgFrontendUI.h"
37 #include "ui/struct/SoftwareVersion.h"
38 
39 namespace GpgFrontend::UI {
40 
46  Q_OBJECT
47 
48  public:
53  explicit VersionCheckTask();
54 
55  signals:
56 
63 
64  protected:
70  void Run() override;
71 
72  private slots:
73 
78  void slot_parse_latest_version_info();
79 
84  void slot_parse_current_version_info();
85 
86  private:
87  QByteArray latest_reply_bytes_;
88  QByteArray current_reply_bytes_;
89  QNetworkReply* latest_reply_ = nullptr;
90  QNetworkReply* current_reply_ = nullptr;
91  QNetworkAccessManager* network_manager_;
92  std::string current_version_;
93  SoftwareVersion version_;
94 };
95 
96 } // namespace GpgFrontend::UI
97 
98 #endif // GPGFRONTEND_VERSIONCHECKTHREAD_H
GpgFrontend::UI
Definition: FileReadTask.cpp:31
GpgFrontend::UI::VersionCheckTask::SignalUpgradeVersion
void SignalUpgradeVersion(SoftwareVersion version)
GpgFrontend::UI::SoftwareVersion
Definition: SoftwareVersion.h:39
GpgFrontend::UI::VersionCheckTask::latest_reply_
QNetworkReply * latest_reply_
latest version info reply
Definition: VersionCheckTask.h:89
GpgFrontend::UI::VersionCheckTask
Definition: VersionCheckTask.h:45
GpgFrontend::UI::VersionCheckTask::VersionCheckTask
VersionCheckTask()
Construct a new Version Check Thread object.
Definition: VersionCheckTask.cpp:38
GpgFrontend::Thread::Task
Definition: Task.h:45
GpgFrontend::Thread::Task::SetFinishAfterRun
void SetFinishAfterRun(bool finish_after_run)
Set the Finish After Run object.
Definition: Task.cpp:73
GpgFrontend::UI::VersionCheckTask::current_reply_
QNetworkReply * current_reply_
current version info reply
Definition: VersionCheckTask.h:90
GpgFrontend::UI::VersionCheckTask::Run
void Run() override
Run - run the task.
Definition: VersionCheckTask.cpp:47