2013-07-24 16:41:12 +00:00
|
|
|
/*
|
2024-09-17 19:00:25 +00:00
|
|
|
* Deskflow -- mouse and keyboard sharing utility
|
2025-01-24 00:11:17 +00:00
|
|
|
* SPDX-FileCopyrightText: (C) 2012 Symless Ltd.
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
2013-07-24 16:41:12 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
#include <QString>
|
|
|
|
|
|
|
|
|
|
class QNetworkAccessManager;
|
|
|
|
|
class QNetworkReply;
|
|
|
|
|
|
2024-10-17 18:04:35 +00:00
|
|
|
class VersionChecker : public QObject
|
|
|
|
|
{
|
2024-07-02 19:07:06 +00:00
|
|
|
Q_OBJECT
|
2013-07-24 16:41:12 +00:00
|
|
|
public:
|
2025-03-21 02:24:40 +00:00
|
|
|
explicit VersionChecker(QObject *parent = nullptr);
|
2024-07-26 22:53:52 +00:00
|
|
|
void checkLatest() const;
|
2025-05-31 15:35:37 +00:00
|
|
|
public Q_SLOTS:
|
2024-07-02 19:07:06 +00:00
|
|
|
void replyFinished(QNetworkReply *reply);
|
2025-05-31 15:35:37 +00:00
|
|
|
Q_SIGNALS:
|
2024-07-02 19:07:06 +00:00
|
|
|
void updateFound(const QString &version);
|
|
|
|
|
|
2013-07-24 16:41:12 +00:00
|
|
|
private:
|
2024-07-26 22:53:52 +00:00
|
|
|
static int compareVersions(const QString &left, const QString &right);
|
2019-08-22 13:02:40 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
/**
|
|
|
|
|
* \brief Converts a string stage to a integer value
|
|
|
|
|
* \param stage The string containing the stage version
|
|
|
|
|
* \return An integer representation of the stage, the higher the number the
|
|
|
|
|
* more recent the version
|
|
|
|
|
*/
|
2024-07-26 22:53:52 +00:00
|
|
|
static int getStageVersion(QString stage);
|
2025-03-21 02:24:40 +00:00
|
|
|
QNetworkAccessManager *m_network = nullptr;
|
2013-07-24 16:41:12 +00:00
|
|
|
};
|