X-Git-Url: https://git.sven.stormbind.net/?a=blobdiff_plain;f=version.cpp;fp=version.cpp;h=0000000000000000000000000000000000000000;hb=d483bd8e6523c23c6f1d8908a2e0611c2bc9ff4f;hp=a39525eadf93405464cd3183ce890fb0e4eaaabd;hpb=7dfa3fe589d1722d49681f42cdb0bf1e6efb5223;p=sven%2Fvym.git diff --git a/version.cpp b/version.cpp deleted file mode 100644 index a39525e..0000000 --- a/version.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include "version.h" - -#include -#include - -bool versionLowerThanVym (const QString &v) -{ - // returns true, if Version v < VYM_VERSION - if (v == __VYM_VERSION) - return false; - else - return versionLowerOrEqualThanVym(v); -} - - -bool versionLowerOrEqualThanVym (const QString &v) -{ - // returns true, if Version v <= VYM_VERSION - return versionLowerOrEqual (v,__VYM_VERSION); -} - - -bool versionLowerOrEqual (const QString &v, const QString &vstatic) -{ - // returns true, if version v <= vstatic - bool ok = false; - int v1 = 0; - int v2 = 0; - int v3 = 0; - int vs1 = 0; - int vs2 = 0; - int vs3 = 0; - - QRegExp rx("(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})"); - int pos = rx.indexIn (v); - if (pos > -1) - { - v1 = rx.cap(1).toInt(&ok); - if (ok) v2 = rx.cap(2).toInt(&ok); - if (ok) v3 =rx.cap(3).toInt(&ok); - } - - pos=rx.indexIn (vstatic); - if (ok && pos>-1) - { - vs1=rx.cap(1).toInt(&ok); - if (ok) vs2=rx.cap(2).toInt(&ok); - if (ok) vs3=rx.cap(3).toInt(&ok); - } - - if (!ok) - { - qWarning ()< v1) return true; - if (vs1 < v1) return false; - if (vs2 > v2) return true; - if (vs2 < v2) return false; - if (vs3 > v3) return true; - if (vs3 < v3) return false; - return true; - -}