#include "versioncheck.h" #include "SNCDataBase.h" #include "loghelper.h" VersionCheck::VersionCheck() { this->local_app_version = SNCDataBase::getAppVersion(); this->appconfig_url = SNCDataBase::getAppConfigUrl(); stop = false; manager = 0; } VersionCheck::~VersionCheck() { qDebug()<local_app_version; QRegExp exp("\\d+\.\\d+\.\\d+"); qDebug()<force = true; } else { this->force = false; } return true; } return false; } bool VersionCheck::isForce() { return this->force; } bool VersionCheck::getServerConfig() { QString config_url = appconfig_url; qDebug()<readAll(); QTextCodec::setCodecForCStrings(QTextCodec::codecForName("system")); QTextCodec::setCodecForTr(QTextCodec::codecForName("system")); if(reply) delete reply; return content; } bool VersionCheck::compare(QString ver1, QString ver2) { QStringList list = ver1.split("."); int ver1Major = list.at(0).toInt(); int ver1Middle = list.at(1).toInt(); int ver1Last = list.at(2).toInt(); list = ver2.split("."); int ver2Major = list.at(0).toInt(); int ver2Middle = list.at(1).toInt(); int ver2Last = list.at(2).toInt(); qDebug()<