Skip to content
Snippets Groups Projects
Commit e2e7a7cc authored by tobias's avatar tobias
Browse files

Change UpdateRegistry#lookupUpdates

parent e680785e
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,6 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
......@@ -339,7 +338,6 @@ public class PlayPadMain extends Application implements LocalizationDelegate, Pl
if (newProfile.getProfileSettings().isAutoUpdate()) {
Worker.runLater(() ->
{
try {
UpdateRegistery.lookupUpdates(newProfile.getProfileSettings().getUpdateChannel());
if (!UpdateRegistery.getAvailableUpdates().isEmpty()) {
Platform.runLater(() ->
......@@ -357,7 +355,6 @@ public class PlayPadMain extends Application implements LocalizationDelegate, Pl
});
});
}
} catch (IOException | URISyntaxException e) {}
});
}
}
......
......@@ -206,7 +206,7 @@ public class Strings {
public static final String UI_Window_Settings_Updates_CurrentVersion = "UI.Window.Settings.Updates.CurrentVersion";
// Error - Update - Downlaod
public static final String Error_Update_Download = "Error.Update.Download";
@Deprecated public static final String Error_Update_Download = "Error.Update.Download";
// Layout
public static final String Layout_Modern_Name = "Layout.Modern.Name";
......
package de.tobias.playpad.viewcontroller.option;
import java.io.IOException;
import java.net.URISyntaxException;
import de.tobias.playpad.PlayPadMain;
import de.tobias.playpad.Strings;
......@@ -99,12 +98,7 @@ public class UpdateTabViewController extends SettingsTabViewController {
Worker.runLater(() ->
{
// Search for updates
try {
UpdateRegistery.lookupUpdates(profile.getProfileSettings().getUpdateChannel());
} catch (IOException | URISyntaxException e) {
e.printStackTrace();
showErrorMessage(Localization.getString(Strings.Error_Update_Download, e.getLocalizedMessage()));
}
Platform.runLater(() ->
{
......
......@@ -25,13 +25,17 @@ public class UpdateRegistery {
return availableUpdates;
}
public static List<Updatable> lookupUpdates(UpdateChannel channel) throws IOException, URISyntaxException {
public static List<Updatable> lookupUpdates(UpdateChannel channel) {
availableUpdates.clear();
for (Updatable updatable : UpdateRegistery.updatables) {
try {
updatable.loadInformation(channel);
if (updatable.isUpdateAvailable()) {
availableUpdates.add(updatable);
}
} catch (IOException | URISyntaxException e) {
}
}
return availableUpdates;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment