更新 'src/GUI/UpdateChecker.cxx'

This commit is contained in:
zhongjin 2022-12-07 13:34:07 +08:00
parent e4b4d93f7f
commit 4fa1253534

View File

@ -84,18 +84,22 @@ UpdateChecker::UpdateChecker(QObject *parent) : QObject(parent)
QSettings settings; QSettings settings;
QDate nextCheck = settings.value("next-update-check").toDate(); QDate nextCheck = settings.value("next-update-check").toDate();
//zhongjin
SG_LOG(SG_IO, SG_WARN, "UpdateChecker()" << nextCheck);
if (!nextCheck.isValid()) { if (!nextCheck.isValid()) {
// check tomorrow, so we don't nag immediately after insstallaion // check tomorrow, so we don't nag immediately after insstallaion
const QDate n = QDate::currentDate().addDays(1); const QDate n = QDate::currentDate().addDays(1);
settings.setValue("next-update-check", n); settings.setValue("next-update-check", n);
return; return;
} }
if (nextCheck <= QDate::currentDate()) { if (nextCheck <= QDate::currentDate()) {
//zhongjin
SG_LOG(SG_IO, SG_WARN, "UpdateChecker()" << nextCheck);
// start a check // start a check
auto http = globals->get_subsystem<FGHTTPClient>(); auto http = globals->get_subsystem<FGHTTPClient>();
if (!http) { if (!http) {