SaveTool: change how versions are evaluated.

This allows pre-releases and beta versions to be considered out of date
once complete versions are released.
This commit is contained in:
Guillaume Jacquemin 2021-12-02 19:52:26 +01:00
parent c6de9c1940
commit 321e8feed0

View file

@ -404,10 +404,7 @@ void SaveTool::updateCheckEvent(SDL_Event& event) {
static const Version current_ver{SAVETOOL_VERSION};
Version latest_ver{response[0]["tag_name"]};
if(latest_ver == current_ver) {
_queue.addToast(Toast::Type::Success, "The application is already up to date.");
}
else if(latest_ver > current_ver) {
if(latest_ver > current_ver || (latest_ver == current_ver && Utility::String::endsWith(SAVETOOL_VERSION, "-pre"))) {
_queue.addToast(Toast::Type::Warning, "Your version is out of date.\nCheck the settings for more information.",
std::chrono::milliseconds{5000});
_updateAvailable = true;
@ -415,6 +412,9 @@ void SaveTool::updateCheckEvent(SDL_Event& event) {
_releaseLink = response[0]["html_url"];
_downloadLink = response[0]["assets"][0]["browser_download_url"];
}
else if(latest_ver == current_ver) {
_queue.addToast(Toast::Type::Success, "The application is already up to date.");
}
else if(current_ver > latest_ver) {
_queue.addToast(Toast::Type::Warning, "Your version is more recent than the latest one in the repo. How???");
}