diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:07:43 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:07:43 +0200 |
commit | 4226e548662339ea1ca37b45385a7cf9b237ff1e (patch) | |
tree | 9a3fa54b85d97f05164e41bdb96b82f748a37342 /ui/checkVersion.cpp | |
parent | 3.7 (diff) | |
download | FreeFileSync-4226e548662339ea1ca37b45385a7cf9b237ff1e.tar.gz FreeFileSync-4226e548662339ea1ca37b45385a7cf9b237ff1e.tar.bz2 FreeFileSync-4226e548662339ea1ca37b45385a7cf9b237ff1e.zip |
3.8
Diffstat (limited to 'ui/checkVersion.cpp')
-rw-r--r-- | ui/checkVersion.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ui/checkVersion.cpp b/ui/checkVersion.cpp index 7a509204..36d609b1 100644 --- a/ui/checkVersion.cpp +++ b/ui/checkVersion.cpp @@ -12,7 +12,6 @@ #include <wx/utils.h> #include <wx/timer.h> #include "../shared/globalFunctions.h" -//#include "smallDialogs.h" #include "messagePopup.h" #include "../shared/standardPaths.h" @@ -45,13 +44,13 @@ bool getOnlineVersion(wxString& version) CloseConnectionOnExit dummy2(httpStream, webAccess); webAccess.SetHeader(wxT("Content-type"), wxT("text/html; charset=utf-8")); - webAccess.SetTimeout(10); //10 seconds of timeout instead of 10 minutes... + webAccess.SetTimeout(5); //5 seconds of timeout instead of 10 minutes... if (webAccess.Connect(wxT("freefilesync.cvs.sourceforge.net"))) //only the server, no pages here yet... { //wxApp::IsMainLoopRunning(); // should return true - httpStream = webAccess.GetInputStream(wxT("/viewvc/*checkout*/freefilesync/version/version.txt")); + httpStream = webAccess.GetInputStream(wxT("/viewvc/freefilesync/version/version.txt")); if (httpStream && webAccess.GetError() == wxPROTO_NOERR) { @@ -77,11 +76,13 @@ bool newerVersionExists(const wxString& onlineVersion) const wxChar VERSION_SEP = wxT('.'); + using globalFunctions::stringToNumber; + while ( currentVersionCpy.Find(VERSION_SEP) != wxNOT_FOUND || onlineVersionCpy.Find(VERSION_SEP) != wxNOT_FOUND) { - const int currentMajor = globalFunctions::wxStringToInt(currentVersionCpy.BeforeFirst(VERSION_SEP)); //Returns the whole string if VERSION_SEP is not found. - const int onlineMajor = globalFunctions::wxStringToInt(onlineVersionCpy.BeforeFirst(VERSION_SEP)); //Returns the whole string if VERSION_SEP is not found. + const int currentMajor = stringToNumber<int>(currentVersionCpy.BeforeFirst(VERSION_SEP)); //Returns the whole string if VERSION_SEP is not found. + const int onlineMajor = stringToNumber<int>(onlineVersionCpy.BeforeFirst(VERSION_SEP)); //Returns the whole string if VERSION_SEP is not found. if (currentMajor != onlineMajor) return currentMajor < onlineMajor; @@ -90,7 +91,7 @@ bool newerVersionExists(const wxString& onlineVersion) onlineVersionCpy = onlineVersionCpy.AfterFirst(VERSION_SEP); //Returns the empty string if VERSION_SEP is not found. } - return globalFunctions::wxStringToInt(currentVersionCpy) < globalFunctions::wxStringToInt(onlineVersionCpy); + return stringToNumber<int>(currentVersionCpy) < stringToNumber<int>(onlineVersionCpy); } |