Added version compare

This commit is contained in:
0xFEEDC0DE64
2017-12-07 00:34:29 +01:00
parent e4d8f61f19
commit 78da01e53e

View File

@@ -5,6 +5,7 @@
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QDebug>
#include <QVersionNumber>
#include <QJsonParseError>
#include <QJsonDocument>
#include <QJsonArray>
@@ -50,10 +51,15 @@ void UpdateDialog::finished()
return;
}
auto appVersion = QVersionNumber::fromString(QCoreApplication::applicationVersion());
auto array = document.array();
for(const auto &releaseVal : array)
{
qDebug() << releaseVal;
auto releaseObj = releaseVal.toObject();
auto version = QVersionNumber::fromString(releaseObj.value("tag_name").toString());
qDebug() << version << (appVersion < version);
}
}