From 98f3aa03e125086cd2a2e3cd6c2e342e9163c997 Mon Sep 17 00:00:00 2001 From: Nick Vrvilo Date: Tue, 28 May 2019 23:16:44 -0500 Subject: [PATCH] Switch to date-based versions --- Changes.txt | 7 +++++++ installer/GedTools.nsi | 6 +++--- src/MainWindow.cpp | 4 ++-- src/UpdateChecker.cpp | 16 +++++++++++----- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/Changes.txt b/Changes.txt index 98bd6a5..6732823 100644 --- a/Changes.txt +++ b/Changes.txt @@ -1,5 +1,12 @@ GedTools - Version History +2019.05.28 - 28 May 2019 +* Changed versioning scheme to YYYY.MM.DD (release date) format. +* Added toggle for auto-marking people over 110 years as DECEASED, + now disabled by default. +* Added toggle for tagging calculated dates using ABT ("about") or EST + ("estimated"), with the less accurate but more common ABT as default. + 1.11.0 - 14 May 2016 * Added option to choose whether or not to use adoptive relationships when estimating missing dates in a family tree. diff --git a/installer/GedTools.nsi b/installer/GedTools.nsi index 44bcd6f..68ef56c 100644 --- a/installer/GedTools.nsi +++ b/installer/GedTools.nsi @@ -7,7 +7,7 @@ ;Name and file Name "GedTools" - OutFile "GedTools-1_11_0-win32-installer.exe" + OutFile "GedTools-20190528-win32-installer.exe" ;Default installation folder InstallDir $PROGRAMFILES\GedTools @@ -81,7 +81,7 @@ Section File ..\bin\GedTools.exe File ..\gpl-3.0.txt File ..\PinyinMap.dat - File ..\Readme.txt + File ..\Readme.md File mingwm10.dll File libgcc_s_dw2-1.dll File QtCore4.dll @@ -115,7 +115,7 @@ Section "Uninstall" Delete $INSTDIR\QtCore4.dll Delete $INSTDIR\QtGui4.dll Delete $INSTDIR\QtNetwork4.dll - Delete $INSTDIR\Readme.txt + Delete $INSTDIR\Readme.md Delete $INSTDIR\Changes.txt Delete $INSTDIR\lang\GedTools_en.qm Delete $INSTDIR\lang\GedTools_zh.qm diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 410b2e5..cbd5606 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -10,8 +10,8 @@ //=== Constants ===// // Program Version -const char MainWindow::VERSION_NUMBER[] = "1.11.0"; -const char MainWindow::COPYRIGHT_YEAR[] = "2016"; +const char MainWindow::VERSION_NUMBER[] = "2019.05.28"; +const char MainWindow::COPYRIGHT_YEAR[] = "2019"; // File that disables auto updates const char MainWindow::NO_UPDATE_FILE[] = "noUpdates"; diff --git a/src/UpdateChecker.cpp b/src/UpdateChecker.cpp index a7d8e6d..8b47589 100644 --- a/src/UpdateChecker.cpp +++ b/src/UpdateChecker.cpp @@ -32,9 +32,7 @@ bool UpdateChecker::finished() const { return _finished; } -/* Has major update - * True if a non-minor version change has been made - * (Numbers before the first two dots have changed) +/* A newer release is available than the current version */ bool UpdateChecker::hasUpdate() const { return _hasUpdate; @@ -81,6 +79,14 @@ void UpdateChecker::check() { //=== Network Action Slots ===// +/* Returns true if newVer is newer (greater) than oldVer. + * Returns ifEqual when oldVer and newVer are equal. + * You can chain calls in the ifEqual positon. + */ +static inline bool cmpVer(int oldVer, int newVer, bool ifEqual = false) { + return (oldVer == newVer) ? ifEqual : (oldVer < newVer); +} + /* Called when the Network Manager has finished its request */ void UpdateChecker::requestFinished(QNetworkReply * reply) { @@ -91,8 +97,8 @@ void UpdateChecker::requestFinished(QNetworkReply * reply) { int nv1 = versionExp.cap(1).toInt(); int nv2 = versionExp.cap(2).toInt(); int nv3 = versionExp.cap(3).toInt(); - _hasUpdate = (_v1 < nv1) || ((_v1 == nv1) && (_v2 < nv2)); - _hasMinorUpdate = _hasUpdate || ((_v2 == nv2) && (_v3 < nv3)); + _hasUpdate = cmpVer(_v1, nv1, cmpVer(_v2, nv2, cmpVer(_v3, nv3))); + _hasMinorUpdate = _hasUpdate; // Finished! _finished = true; // Emit a signal so that users know that the request has