Update to a non-deprecated method to determine network connectivity

Signed-off-by: Taylor Smock <taylor.smock@kaart.com>
pull/1/head
Taylor Smock 2020-05-20 11:04:01 -06:00
rodzic e5897da7f7
commit dee0b13fc7
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 625F6A74A3E4311A
3 zmienionych plików z 5 dodań i 11 usunięć

Wyświetl plik

@ -141,6 +141,7 @@ spotless {
josm {
debugPort = 7055
manifest {
oldVersionDownloadLink 16284, "v1.5.5", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v1.5.5/mapwithai.jar")
oldVersionDownloadLink 16220, "v1.4.2", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v1.4.2/mapwithai.jar")
oldVersionDownloadLink 15820, "v1.3.7", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v1.3.7/mapwithai.jar")
oldVersionDownloadLink 15737, "v1.2.3", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v1.2.3/mapwithai.jar")

Wyświetl plik

@ -1,9 +1,9 @@
# The minimum JOSM version this plugin is compatible with (can be any numeric version
plugin.main.version = 16284
plugin.main.version = 16434
# The JOSM version this plugin is currently compiled against
# Please make sure this version is available at https://josm.openstreetmap.de/download
# The special values "latest" and "tested" are also possible here, but not recommended.
plugin.compile.version = 16284
plugin.compile.version = 16434
plugin.canloadatruntime = true
plugin.author = Taylor Smock <incoming+gokaart/JOSM_MapWithAI@incoming.gitlab.com>
plugin.class = org.openstreetmap.josm.plugins.mapwithai.MapWithAIPlugin

Wyświetl plik

@ -22,8 +22,7 @@ import org.openstreetmap.josm.data.imagery.ImageryInfo;
import org.openstreetmap.josm.gui.PleaseWaitRunnable;
import org.openstreetmap.josm.gui.util.GuiHelper;
import org.openstreetmap.josm.io.CachedFile;
import org.openstreetmap.josm.io.OfflineAccessException;
import org.openstreetmap.josm.io.OnlineResource;
import org.openstreetmap.josm.io.NetworkManager;
import org.openstreetmap.josm.io.imagery.ImageryReader;
import org.openstreetmap.josm.plugins.mapwithai.data.mapwithai.MapWithAIInfo.MapWithAIPreferenceEntry;
import org.openstreetmap.josm.plugins.mapwithai.io.mapwithai.MapWithAISourceReader;
@ -173,13 +172,7 @@ public class MapWithAILayerInfo {
}
protected void loadSource(String source) {
boolean online = true;
try {
OnlineResource.JOSM_WEBSITE.checkOfflineAccess(source, Config.getUrls().getJOSMWebsite());
} catch (OfflineAccessException e) {
Logging.log(Logging.LEVEL_WARN, e);
online = false;
}
boolean online = NetworkManager.isOffline(source);
if (clearCache && online) {
CachedFile.cleanup(source);
}