VersionNumber parsing

This commit is contained in:
Nav
2021-10-19 23:00:54 +01:00
parent 10b80e24ba
commit 8433a87fbf
9 changed files with 116 additions and 16 deletions

View File

@@ -11,6 +11,7 @@
#include "src/Application.hpp"
#include "InsightWorker/Tasks/QueryLatestVersionNumber.hpp"
#include "src/VersionNumber.hpp"
using namespace Bloom;
using namespace Bloom::Exceptions;
@@ -160,20 +161,20 @@ void Insight::shutdown() {
}
void Insight::checkBloomVersion() {
auto currentVersionNumber = QString::fromStdString(Application::VERSION_STR);
auto currentVersionNumber = Application::VERSION;
auto versionQueryTask = new QueryLatestVersionNumber(
QString::fromStdString(Application::VERSION_STR)
currentVersionNumber
);
this->connect(
versionQueryTask,
&QueryLatestVersionNumber::latestVersionNumberRetrieved,
this,
[this, currentVersionNumber] (const QString& latestVersionNumber) {
if (latestVersionNumber != currentVersionNumber) {
[this, currentVersionNumber] (const VersionNumber& latestVersionNumber) {
if (latestVersionNumber > currentVersionNumber) {
Logger::warning(
"Bloom v" + latestVersionNumber.toStdString()
"Bloom v" + latestVersionNumber.toString()
+ " is available to download - upgrade via https://bloom.oscillate.io"
);
}