Index: sources/ApplicationPost.cpp =================================================================== diff -u -r7afdd47e30a761efd8ed08988f53337ea4e74ed6 -r5a9b7ff46df9cecc258f7cb18019a51bca76bce3 --- sources/ApplicationPost.cpp (.../ApplicationPost.cpp) (revision 7afdd47e30a761efd8ed08988f53337ea4e74ed6) +++ sources/ApplicationPost.cpp (.../ApplicationPost.cpp) (revision 5a9b7ff46df9cecc258f7cb18019a51bca76bce3) @@ -88,36 +88,40 @@ */ bool ApplicationPost::checkOSVersion() { - QString exr("%1\\s*\"\\d+\\.\\d+\\.\\d+\""); - QRegExp reg(exr.arg(_postmsg_osversion)); - QString captured; + QString exrVer("%1\\s*\"\\d+\\.\\d+\\.\\d+\""); + QString exrBld("%1\\s*\"\\d+\""); + + QRegExp regVer(exrVer.arg(_postmsg_osversion)); + QRegExp regBld(exrBld.arg(_postmsg_osbuild )); + QString version; + QString build; QStringList versions; quint16 major; quint16 minor; quint16 micro; // check the statement exists in the long - int row = _content.indexOf (reg); - bool ok = row >= 0; // found - if ( ! ok ) goto lErr; + int rowVer = _content.indexOf (regVer); + int rowBld = _content.indexOf (regBld); Q_UNUSED(rowBld); + bool ok = rowVer >= 0; // found + if ( ! ok ) goto lOut; // check the Os version is compatible - captured = reg.cap(0); // 0 is the first captured and next if any are the subsets. - versions = captured.replace(_postmsg_osversion,"").replace("\"","").split("."); + version = regVer.cap(0).replace(_postmsg_osversion,"").replace("\"",""); // 0 is the first captured and next if any are the subsets. + build = regBld.cap(0).replace(_postmsg_osbuild ,"").replace("\"",""); // 0 is the first captured and next if any are the subsets. + versions = version.split("."); major = versions[0].toUInt(); // type, existance, count has been already tested by regex, and was rejected in first check section. minor = versions[1].toUInt(); // type, existance, count has been already tested by regex, and was rejected in first check section. micro = versions[2].toUInt(); // type, existance, count has been already tested by regex, and was rejected in first check section. ok = major >= Storage::OS_VERSION_MAJOR && minor >= Storage::OS_VERSION_MINOR && micro >= Storage::OS_VERSION_MICRO ; - if ( ! ok ) goto lErr; + if ( ! ok ) goto lOut; - // if ok then - emit didOSVersion(ok); - return ok; + _osVersion = version + "." + build; -lErr: - emit didFail(Gui::GuiAlarmID::ALARM_ID_HD_UI_POST_FAILURE_OS_VERSION); +lOut: + if ( !ok ) emit didFail(Gui::GuiAlarmID::ALARM_ID_HD_UI_POST_FAILURE_OS_VERSION); emit didOSVersion(ok); return ok; }