diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:59:28 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:59:28 +0200 |
commit | e303a7bcdb5ce6c7afb368d329fbbba8088328f6 (patch) | |
tree | d74d651b8d0c17f5195ac22d1751ce29c35e082a | |
parent | 2.0 (diff) | |
download | FreeFileSync-e303a7bcdb5ce6c7afb368d329fbbba8088328f6.tar.gz FreeFileSync-e303a7bcdb5ce6c7afb368d329fbbba8088328f6.tar.bz2 FreeFileSync-e303a7bcdb5ce6c7afb368d329fbbba8088328f6.zip |
2.1
-rw-r--r-- | BUILD/Changelog.txt | 5 | ||||
-rw-r--r-- | BUILD/Readme.txt | 2 | ||||
-rw-r--r-- | BUILD/Resources.dat | bin | 237836 -> 237646 bytes | |||
-rw-r--r-- | Cleanup.cmd | 1 | ||||
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | library/globalFunctions.cpp | 6 | ||||
-rw-r--r-- | ui/SmallDialogs.cpp | 15 | ||||
-rw-r--r-- | ui/SmallDialogs.h | 2 | ||||
-rw-r--r-- | ui/checkVersion.cpp | 32 | ||||
-rw-r--r-- | ui/guiStatusHandler.cpp | 5 | ||||
-rw-r--r-- | version/version.h | 2 |
11 files changed, 55 insertions, 21 deletions
diff --git a/BUILD/Changelog.txt b/BUILD/Changelog.txt index 22259889..18b836bb 100644 --- a/BUILD/Changelog.txt +++ b/BUILD/Changelog.txt @@ -1,6 +1,11 @@ FreeFileSync ------------ +Changelog v2.1 +---------------- +Fixed bug that could cause FreeFileSync to crash after synchronization + + Changelog v2.0 --------------- Copy locked files using Windows Volume Shadow Copy diff --git a/BUILD/Readme.txt b/BUILD/Readme.txt index 5410ca5b..4bdd29f7 100644 --- a/BUILD/Readme.txt +++ b/BUILD/Readme.txt @@ -1,4 +1,4 @@ -FreeFileSync v2.0 +FreeFileSync v2.1 ------------------ Usage diff --git a/BUILD/Resources.dat b/BUILD/Resources.dat Binary files differindex 2590f076..48d36964 100644 --- a/BUILD/Resources.dat +++ b/BUILD/Resources.dat diff --git a/Cleanup.cmd b/Cleanup.cmd index 23f31809..6104d1b7 100644 --- a/Cleanup.cmd +++ b/Cleanup.cmd @@ -13,6 +13,7 @@ del FreeFileSync.suo del FreeFileSync.vcproj.*.user del FreeFileSync.sln del BUILD\FreeFileSync.pdb +del BUILD\FreeFileSync.ilk del library\ShadowCopy\ShadowCopy.ncb attrib library\ShadowCopy\ShadowCopy.suo -h @@ -6,9 +6,6 @@ all: FreeFileSync init: if [ ! -d OBJ ]; then mkdir OBJ; fi -removeBOM: tools/removeBOM.cpp - g++ -o removeBOM tools/removeBOM.cpp - structures.o: structures.cpp g++ $(CPPFLAGS) structures.cpp -o OBJ/structures.o @@ -66,6 +63,9 @@ smallDialogs.o: ui/smallDialogs.cpp dragAndDrop.o: ui/dragAndDrop.cpp g++ $(CPPFLAGS) ui/dragAndDrop.cpp -o OBJ/dragAndDrop.o +removeBOM: tools/removeBOM.cpp + g++ -o removeBOM tools/removeBOM.cpp + localization.o: library/localization.cpp removeBOM ./removeBOM library/localization.cpp g++ $(CPPFLAGS) library/localization.cpp -o OBJ/localization.o diff --git a/library/globalFunctions.cpp b/library/globalFunctions.cpp index 33932d67..2f5efab7 100644 --- a/library/globalFunctions.cpp +++ b/library/globalFunctions.cpp @@ -49,7 +49,8 @@ int globalFunctions::wxStringToInt(const wxString& number) if (number.ToLong(&result)) return result; else - throw RuntimeException(wxString(_("Conversion error:")) + wxT(" wxString -> long")); + return 0; //don't throw exceptions here: wxEmptyString shall be interpreted as 0 + //throw RuntimeException(wxString(_("Conversion error:")) + wxT(" wxString -> long")); } @@ -59,7 +60,8 @@ double globalFunctions::wxStringToDouble(const wxString& number) if (number.ToDouble(&result)) return result; else - throw RuntimeException(wxString(_("Conversion error:")) + wxT(" wxString -> double")); + return 0; //don't throw exceptions here: wxEmptyString shall be interpreted as 0 + //throw RuntimeException(wxString(_("Conversion error:")) + wxT(" wxString -> double")); } diff --git a/ui/SmallDialogs.cpp b/ui/SmallDialogs.cpp index db20e526..4565e16b 100644 --- a/ui/SmallDialogs.cpp +++ b/ui/SmallDialogs.cpp @@ -924,7 +924,7 @@ void SyncStatus::setStatusText_NoUpdate(const Zstring& text) } -void SyncStatus::updateStatusDialogNow() +void SyncStatus::updateStatusDialogNow(bool flushWindowMessages) { //static RetrieveStatistics statistic; @@ -988,13 +988,15 @@ void SyncStatus::updateStatusDialogNow() bSizer28->Layout(); bSizer31->Layout(); } - updateUiNow(); + if (flushWindowMessages) + updateUiNow(); //support for pause button while (processPaused && currentProcessIsRunning) { wxMilliSleep(UI_UPDATE_INTERVAL); - updateUiNow(); + if (flushWindowMessages) + updateUiNow(); } } @@ -1063,8 +1065,11 @@ void SyncStatus::processHasFinished(SyncStatusID id) //essential to call this in bSizerSpeed->Show(false); bSizerRemTime->Show(false); - updateStatusDialogNow(); //keep this sequence to avoid display distortion, if e.g. only 1 item is sync'ed - Layout(); // + //ATTENTION don't call wxAPP->Yield()! at this point in time there is a mismatch between + //gridDataView and currentGridData!! avoid grid repaint at all costs!! + + updateStatusDialogNow(false); //keep this sequence to avoid display distortion, if e.g. only 1 item is sync'ed + Layout(); // } diff --git a/ui/SmallDialogs.h b/ui/SmallDialogs.h index e9156665..da627e82 100644 --- a/ui/SmallDialogs.h +++ b/ui/SmallDialogs.h @@ -287,7 +287,7 @@ public: void resetGauge(int totalObjectsToProcess, wxLongLong totalDataToProcess); void incProgressIndicator_NoUpdate(int objectsProcessed, wxLongLong dataProcessed); void setStatusText_NoUpdate(const Zstring& text); - void updateStatusDialogNow(); + void updateStatusDialogNow(bool flushWindowMessages = true); void setCurrentStatus(SyncStatusID id); void processHasFinished(SyncStatusID id); //essential to call this in StatusUpdater derived class destructor at the LATEST(!) to prevent access to currentStatusUpdater diff --git a/ui/checkVersion.cpp b/ui/checkVersion.cpp index 914e5e09..16d37036 100644 --- a/ui/checkVersion.cpp +++ b/ui/checkVersion.cpp @@ -64,16 +64,34 @@ bool getOnlineVersion(wxString& version) bool newerVersionExists(const wxString& onlineVersion) { - const wxString currentMajor = FreeFileSync::currentVersion.BeforeLast(wxT('.')); - const wxString onlineMajor = onlineVersion.BeforeLast(wxT('.')); + wxString currentVersionCpy = FreeFileSync::currentVersion; + wxString onlineVersionCpy = onlineVersion; - if (currentMajor != onlineMajor) - return globalFunctions::wxStringToInt(currentMajor) < globalFunctions::wxStringToInt(onlineMajor); + const wxChar VERSION_SEP = wxT('.'); - const wxString currentMinor = FreeFileSync::currentVersion.AfterLast(wxT('.')); - const wxString onlineMinor = onlineVersion.AfterLast(wxT('.')); + 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); + + if (currentMajor != onlineMajor) + return globalFunctions::wxStringToInt(currentMajor) < globalFunctions::wxStringToInt(onlineMajor); + + currentVersionCpy = currentVersionCpy.AfterFirst(VERSION_SEP); + onlineVersionCpy = onlineVersionCpy.AfterFirst(VERSION_SEP); + } + + 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(currentMinor) < globalFunctions::wxStringToInt(onlineMinor); + return globalFunctions::wxStringToInt(currentVersionCpy) < globalFunctions::wxStringToInt(onlineVersionCpy); } diff --git a/ui/guiStatusHandler.cpp b/ui/guiStatusHandler.cpp index 51714ed8..7929c122 100644 --- a/ui/guiStatusHandler.cpp +++ b/ui/guiStatusHandler.cpp @@ -64,7 +64,10 @@ CompareStatusHandler::CompareStatusHandler(MainDialog* dlg) : CompareStatusHandler::~CompareStatusHandler() { - updateUiNow(); //ui update before enabling buttons again: prevent strange behaviour of delayed button clicks + //ATTENTION don't call wxAPP->Yield()! at this point in time there is a mismatch between + //gridDataView and currentGridData!! avoid grid repaint at all costs!! + + //just DON'T: updateUiNow(); //ui update before enabling buttons again: prevent strange behaviour of delayed button clicks //reenable complete main dialog mainDialog->m_notebookBottomLeft->Enable(); diff --git a/version/version.h b/version/version.h index 003e3872..295d318b 100644 --- a/version/version.h +++ b/version/version.h @@ -2,5 +2,5 @@ namespace FreeFileSync { - static const wxString currentVersion = wxT("2.0"); //internal linkage! + static const wxString currentVersion = wxT("2.1"); //internal linkage! } |