summaryrefslogtreecommitdiff
path: root/ui/checkVersion.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:00:17 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:00:17 +0200
commitfd0853d2623dd278b08288331ed42e3be59252fb (patch)
treea7645daeaef8bdbed064faf4eb88e72cee58726c /ui/checkVersion.cpp
parent2.1 (diff)
downloadFreeFileSync-fd0853d2623dd278b08288331ed42e3be59252fb.tar.gz
FreeFileSync-fd0853d2623dd278b08288331ed42e3be59252fb.tar.bz2
FreeFileSync-fd0853d2623dd278b08288331ed42e3be59252fb.zip
2.2
Diffstat (limited to 'ui/checkVersion.cpp')
-rw-r--r--ui/checkVersion.cpp23
1 files changed, 7 insertions, 16 deletions
diff --git a/ui/checkVersion.cpp b/ui/checkVersion.cpp
index 16d37036..41677094 100644
--- a/ui/checkVersion.cpp
+++ b/ui/checkVersion.cpp
@@ -6,7 +6,7 @@
#include <wx/msgdlg.h>
#include <wx/utils.h>
#include <wx/timer.h>
-#include "../library/globalFunctions.h"
+#include "../shared/globalFunctions.h"
class CloseConnectionOnExit
@@ -69,28 +69,19 @@ bool newerVersionExists(const wxString& onlineVersion)
const wxChar VERSION_SEP = wxT('.');
- while ( currentVersionCpy.Find(VERSION_SEP) != wxNOT_FOUND &&
+ while ( currentVersionCpy.Find(VERSION_SEP) != wxNOT_FOUND ||
onlineVersionCpy.Find(VERSION_SEP) != wxNOT_FOUND)
{
- const wxString currentMajor = currentVersionCpy.BeforeFirst(VERSION_SEP);
- const wxString onlineMajor = onlineVersionCpy.BeforeFirst(VERSION_SEP);
+ 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.
if (currentMajor != onlineMajor)
- return globalFunctions::wxStringToInt(currentMajor) < globalFunctions::wxStringToInt(onlineMajor);
+ return currentMajor < onlineMajor;
- currentVersionCpy = currentVersionCpy.AfterFirst(VERSION_SEP);
- onlineVersionCpy = onlineVersionCpy.AfterFirst(VERSION_SEP);
+ currentVersionCpy = currentVersionCpy.AfterFirst(VERSION_SEP); //Returns the empty string if VERSION_SEP is not found.
+ onlineVersionCpy = onlineVersionCpy.AfterFirst(VERSION_SEP); //Returns the empty string if VERSION_SEP is not found.
}
- const wxString currentMinor = currentVersionCpy.BeforeFirst(VERSION_SEP); //Returns the whole string if VERSION_SEP is not found.
- const wxString onlineMinor = onlineVersionCpy.BeforeFirst(VERSION_SEP); //Returns the whole string if VERSION_SEP is not found.
-
- if (currentMinor != onlineMinor)
- return globalFunctions::wxStringToInt(currentMinor) < globalFunctions::wxStringToInt(onlineMinor);
-
- currentVersionCpy = currentVersionCpy.AfterFirst(VERSION_SEP); //Returns the empty string if VERSION_SEP is not found.
- onlineVersionCpy = onlineVersionCpy.AfterFirst(VERSION_SEP); //Returns the empty string if VERSION_SEP is not found.
-
return globalFunctions::wxStringToInt(currentVersionCpy) < globalFunctions::wxStringToInt(onlineVersionCpy);
}
bgstack15