logic: Fixed update check still displaying new version after using new version
This commit is contained in:
@@ -31,8 +31,9 @@ QtUpdateCheckerWidget::QtUpdateCheckerWidget(QWidget* parent)
|
||||
}
|
||||
else
|
||||
{
|
||||
Version version = appSettings->getUpdateVersion();
|
||||
QString url = QString::fromStdString(appSettings->getUpdateDownloadUrl());
|
||||
if (!url.isEmpty())
|
||||
if (version > Version::getApplicationVersion() && !url.isEmpty())
|
||||
{
|
||||
setDownloadUrl(url);
|
||||
}
|
||||
@@ -52,6 +53,7 @@ QtUpdateCheckerWidget::QtUpdateCheckerWidget(QWidget* parent)
|
||||
void QtUpdateCheckerWidget::checkUpdate(bool force)
|
||||
{
|
||||
ApplicationSettings* appSettings = ApplicationSettings::getInstance().get();
|
||||
appSettings->setUpdateVersion(Version::getApplicationVersion());
|
||||
appSettings->setUpdateDownloadUrl("");
|
||||
appSettings->save();
|
||||
|
||||
@@ -73,6 +75,7 @@ void QtUpdateCheckerWidget::checkUpdate(bool force)
|
||||
{
|
||||
setDownloadUrl(result.url);
|
||||
|
||||
appSettings->setUpdateVersion(result.version);
|
||||
appSettings->setUpdateDownloadUrl(result.url.toStdString());
|
||||
appSettings->save();
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ void QtUpdateChecker::check(bool force, std::function<void(Result)> callback)
|
||||
urlString += ("&platform=" + platformString + "bit").c_str();
|
||||
|
||||
// version
|
||||
// Version::setApplicationVersion(Version::fromString("2017.3.10")); // for debugging
|
||||
// Version::setApplicationVersion(Version::fromString("2017.3.48")); // for debugging
|
||||
urlString += ("&version=" + Version::getApplicationVersion().toDisplayString()).c_str();
|
||||
|
||||
// license
|
||||
@@ -126,6 +126,7 @@ void QtUpdateChecker::check(bool force, std::function<void(Result)> callback)
|
||||
|
||||
if (updateVersion > Version::getApplicationVersion())
|
||||
{
|
||||
result.version = updateVersion;
|
||||
result.url = url;
|
||||
|
||||
ApplicationSettings* appSettings = ApplicationSettings::getInstance().get();
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "qt/utility/QtThreadedFunctor.h"
|
||||
#include "UpdateChecker.h"
|
||||
#include "utility/Version.h"
|
||||
|
||||
class QtUpdateChecker
|
||||
: public UpdateChecker
|
||||
@@ -11,6 +12,7 @@ public:
|
||||
struct Result
|
||||
{
|
||||
bool success = false;
|
||||
Version version;
|
||||
QString url;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user