deskflow/src/lib/gui/VersionChecker.h
sithlord48 d246d9527a Feat: Define QT_NO_KEYWORDS, allowing us to use Qt in more places
must use Q_SIGNALS, Q_SLOTS and Q_EMIT in place of signals, slots and emit macros
2025-06-02 14:28:51 -07:00

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;
};