2 #include <../clientversion.h> 4 #include <QNetworkAccessManager> 5 #include <QNetworkRequest> 6 #include <QNetworkReply> 8 #include <QRegularExpression> 9 #include <QRegularExpressionMatchIterator> 11 #define paternVersion "fabcoin-([0-9]+\\.)?([0-9]+\\.)?([0-9]+)-" 31 QNetworkAccessManager manager;
32 QNetworkReply *response = manager.get(QNetworkRequest(QUrl(
FABCOIN_RELEASES)));
34 connect(response, SIGNAL(finished()), &event, SLOT(quit()));
36 QString html = response->readAll();
39 QRegularExpressionMatchIterator regExIt = regEx.globalMatch(html);
41 QList<Version> versions;
43 while (regExIt.hasNext()) {
44 QRegularExpressionMatch match = regExIt.next();
45 QString versionString = match.captured().mid(5, match.captured().length() - 6);
47 if(!versions.contains(version))
49 versions.append(version);
60 if(!versions.isEmpty())
62 maxVersion = *std::max_element(versions.begin(), versions.end());
Version getMaxReleaseVersion()
#define CLIENT_VERSION_MINOR
FabcoinVersionChecker(QObject *parent=0)
#define CLIENT_VERSION_REVISION
#define CLIENT_VERSION_MAJOR
QList< Version > getVersions()
bool newVersionAvailable()