[fixes #825] Change variable name updateInfo to updateRetriever

As to avoid confusion with the UpdateInfo class
This commit is contained in:
Sibo Van Gool 2022-01-24 12:24:13 +01:00
parent 6ce418556d
commit f13d0ddeb6

View File

@ -146,14 +146,14 @@ public class SwingStartup {
guiModule.startLoader(); guiModule.startLoader();
// Start update info fetching // Start update info fetching
final UpdateInfoRetriever updateInfo; final UpdateInfoRetriever updateRetriever;
if (Application.getPreferences().getCheckUpdates()) { if (Application.getPreferences().getCheckUpdates()) {
log.info("Starting update check"); log.info("Starting update check");
updateInfo = new UpdateInfoRetriever(); updateRetriever = new UpdateInfoRetriever();
updateInfo.start(); updateRetriever.startFetchUpdateInfo();
} else { } else {
log.info("Update check disabled"); log.info("Update check disabled");
updateInfo = null; updateRetriever = null;
} }
// Set the best available look-and-feel // Set the best available look-and-feel
@ -192,7 +192,7 @@ public class SwingStartup {
// Check whether update info has been fetched or whether it needs more time // Check whether update info has been fetched or whether it needs more time
log.info("Checking update status"); log.info("Checking update status");
checkUpdateStatus(updateInfo); checkUpdateStatus(updateRetriever);
} }
@ -213,12 +213,12 @@ public class SwingStartup {
} }
private void checkUpdateStatus(final UpdateInfoRetriever updateInfo) { private void checkUpdateStatus(final UpdateInfoRetriever updateRetriever) {
if (updateInfo == null) if (updateRetriever == null)
return; return;
int delay = 1000; int delay = 1000;
if (!updateInfo.isRunning()) if (!updateRetriever.isRunning())
delay = 100; delay = 100;
final Timer timer = new Timer(delay, null); final Timer timer = new Timer(delay, null);
@ -228,13 +228,13 @@ public class SwingStartup {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (!updateInfo.isRunning()) { if (!updateRetriever.isRunning()) {
timer.stop(); timer.stop();
String current = BuildProperties.getVersion(); String current = BuildProperties.getVersion();
String last = Application.getPreferences().getString(Preferences.LAST_UPDATE, ""); String last = Application.getPreferences().getString(Preferences.LAST_UPDATE, "");
UpdateInfo info = updateInfo.getUpdateInfo(); UpdateInfo info = updateRetriever.getUpdateInfo();
if (info != null && info.getLatestVersion() != null && if (info != null && info.getLatestVersion() != null &&
!current.equals(info.getLatestVersion()) && !current.equals(info.getLatestVersion()) &&
!last.equals(info.getLatestVersion())) { !last.equals(info.getLatestVersion())) {