1 /* 2 * barrier -- mouse and keyboard sharing utility 3 * Copyright (C) 2012-2016 Symless Ltd. 4 * Copyright (C) 2012 Nick Bolton 5 * 6 * This package is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * found in the file LICENSE that should have accompanied this file. 9 * 10 * This package is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #pragma once 20 21 #include <QObject> 22 #include <QString> 23 24 class QNetworkAccessManager; 25 class QNetworkReply; 26 27 class VersionChecker : public QObject 28 { 29 Q_OBJECT 30 public: 31 explicit VersionChecker(QObject* parent = 0); 32 void checkLatest(); 33 QString getVersion(); setApp(const QString & app)34 void setApp(const QString& app) { m_app = app; } 35 int compareVersions(const QString& left, const QString& right); 36 public slots: 37 void replyFinished(QNetworkReply* reply); 38 signals: 39 void updateFound(const QString& version); 40 private: 41 QNetworkAccessManager* m_manager; 42 QString m_app; 43 }; 44