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