mirror of
https://github.com/deskflow/deskflow.git
synced 2026-07-07 21:07:23 +08:00
39 lines
971 B
C++
39 lines
971 B
C++
/*
|
|
* Deskflow -- mouse and keyboard sharing utility
|
|
* SPDX-FileCopyrightText: (C) 2012 Symless Ltd.
|
|
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <QObject>
|
|
#include <QString>
|
|
#include <memory>
|
|
|
|
class QNetworkAccessManager;
|
|
class QNetworkReply;
|
|
|
|
class VersionChecker : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit VersionChecker(QObject *parent = nullptr);
|
|
void checkLatest() const;
|
|
public Q_SLOTS:
|
|
void replyFinished(QNetworkReply *reply);
|
|
Q_SIGNALS:
|
|
void updateFound(const QString &version);
|
|
|
|
private:
|
|
static int compareVersions(const QString &left, const QString &right);
|
|
|
|
/**
|
|
* \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
|
|
*/
|
|
static int getStageVersion(QString stage);
|
|
QNetworkAccessManager *m_network = nullptr;
|
|
};
|