1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
#ifndef UPDATEMANAGER_H
#define UPDATEMANAGER_H
#ifdef PORTABLE_CONFIG
#include "common/global.h"
#include "sqlitestudio.h"
#include <QObject>
#include <functional>
#include <QProcess>
class QNetworkReply;
class QNetworkAccessManager;
class QTemporaryDir;
class QFile;
class API_EXPORT UpdateManager : public QObject
{
Q_OBJECT
public:
explicit UpdateManager(QObject *parent = 0);
~UpdateManager();
void checkForUpdates(bool enforce = false);
bool isPlatformEligibleForUpdate() const;
private:
QString updateBinaryAbsolutePath;
QNetworkAccessManager *netManager = nullptr;
void handleUpdatesResponse(QNetworkReply* response, bool enforced);
private slots:
void handleUpdatingError(const QString& errorMessage);
signals:
void updateAvailable(const QString& version, const QString& url);
void noUpdatesAvailable(bool enforced);
void updatingError(const QString& errorMessage);
};
#define UPDATES SQLITESTUDIO->getUpdateManager()
#endif // PORTABLE_CONFIG
#endif // UPDATEMANAGER_H
|