Update manager and test

This commit is contained in:
Dan Paulat 2023-04-22 22:42:09 -05:00
parent 6412c77a9d
commit 08654bb7b0
5 changed files with 345 additions and 3 deletions

View file

@ -0,0 +1,43 @@
#pragma once
#include <scwx/qt/types/github_types.hpp>
#include <memory>
#include <string>
#include <QObject>
namespace scwx
{
namespace qt
{
namespace manager
{
class UpdateManager : public QObject
{
Q_OBJECT
public:
explicit UpdateManager();
~UpdateManager();
types::gh::Release latest_release() const;
std::string latest_version() const;
bool CheckForUpdates(const std::string& currentVersion = {});
static std::shared_ptr<UpdateManager> Instance();
signals:
void UpdateAvailable(const std::string& latestVersion,
const types::gh::Release& latestRelease);
private:
class Impl;
std::unique_ptr<Impl> p;
};
} // namespace manager
} // namespace qt
} // namespace scwx