更新 'src/GUI/UpdateChecker.cxx'

This commit is contained in:
zhongjin 2022-12-07 13:36:49 +08:00
parent 0d17fe8358
commit 00836f1607

View File

@ -94,11 +94,15 @@ UpdateChecker::UpdateChecker(QObject *parent) : QObject(parent)
return; return;
} }
const QDate n = QDate::currentDate().addDays(0);
settings.setValue("next-update-check", n);
if (nextCheck <= QDate::currentDate()) { if (nextCheck <= QDate::currentDate()) {
//zhongjin //zhongjin
SG_LOG(SG_IO, SG_WARN, "UpdateChecker()" ); SG_LOG(SG_IO, SG_WARN, "UpdateChecker()" );
// start a check // start a check
auto http = globals->get_subsystem<FGHTTPClient>(); auto http = globals->get_subsystem<FGHTTPClient>();
@ -111,6 +115,9 @@ UpdateChecker::UpdateChecker(QObject *parent) : QObject(parent)
// definitiely want to ensure HTTPS for this. // definitiely want to ensure HTTPS for this.
std::string uri = "https://download.flightgear.org/builds/" + _majorMinorVersion + "/updates.xml"; std::string uri = "https://download.flightgear.org/builds/" + _majorMinorVersion + "/updates.xml";
SG_LOG(SG_IO, SG_WARN, "UpdateChecker() " << uri );
m_request = new UpdateXMLRequest(this, uri); m_request = new UpdateXMLRequest(this, uri);
http->makeRequest(m_request); http->makeRequest(m_request);
} else { } else {