Skip to content

Commit

Permalink
Switch to date-based versions
Browse files Browse the repository at this point in the history
  • Loading branch information
DaoWen committed May 29, 2019
1 parent 3fe2e25 commit 98f3aa0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
7 changes: 7 additions & 0 deletions Changes.txt
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
6 changes: 3 additions & 3 deletions installer/GedTools.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
16 changes: 11 additions & 5 deletions src/UpdateChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -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
Expand Down

0 comments on commit 98f3aa0

Please sign in to comment.