VersionCheckTask.h
#ifndef GPGFRONTEND_VERSIONCHECKTHREAD_H
#define GPGFRONTEND_VERSIONCHECKTHREAD_H
#include <memory>
#include <string>
#include "core/thread/Task.h"
#include "ui/GpgFrontendUI.h"
#include "ui/struct/SoftwareVersion.h"
namespace GpgFrontend::UI {
class VersionCheckTask : public Thread::Task {
Q_OBJECT
public:
explicit VersionCheckTask();
signals:
void SignalUpgradeVersion(SoftwareVersion version);
protected:
void Run() override;
private slots:
void slot_parse_latest_version_info();
void slot_parse_current_version_info();
private:
QByteArray latest_reply_bytes_;
QByteArray current_reply_bytes_;
QNetworkReply* latest_reply_ = nullptr;
QNetworkReply* current_reply_ = nullptr;
QNetworkAccessManager* network_manager_;
std::string current_version_;
SoftwareVersion version_;
};
} // namespace GpgFrontend::UI
#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