From 70c907c010c61b42a7bc39cf1c65c65b549c6aab Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 9 Apr 2020 17:25:30 +0300 Subject: [PATCH] Remove unnecessary changes --- .../src/net/osmand/plus/SettingsHelper.java | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/SettingsHelper.java b/OsmAnd/src/net/osmand/plus/SettingsHelper.java index 2ff27bbb65..b70db7d894 100644 --- a/OsmAnd/src/net/osmand/plus/SettingsHelper.java +++ b/OsmAnd/src/net/osmand/plus/SettingsHelper.java @@ -402,26 +402,21 @@ public class SettingsHelper { @Override public void apply() { if (shouldReplace || !exists()) { - OsmandPlugin.addCustomPlugin(app, plugin); - } - CustomOsmandPlugin customPlugin = (CustomOsmandPlugin) OsmandPlugin.getPlugin(getPluginId()); - updatePluginItems(customPlugin); - } - - private void updatePluginItems(CustomOsmandPlugin customPlugin) { - for (SettingsHelper.SettingsItem item : pluginDependentItems) { - if (item instanceof SettingsHelper.FileSettingsItem) { - FileSettingsItem fileItem = (FileSettingsItem) item; - if (fileItem.getSubtype() == FileSettingsItem.FileSubtype.RENDERING_STYLE) { - customPlugin.addRenderer(fileItem.getName()); - } else if (fileItem.getSubtype() == FileSettingsItem.FileSubtype.ROUTING_CONFIG) { - customPlugin.addRouter(fileItem.getName()); - } else if (fileItem.getSubtype() == FileSettingsItem.FileSubtype.OTHER) { - customPlugin.setResourceDirName(item.getFileName()); + for (SettingsHelper.SettingsItem item : pluginDependentItems) { + if (item instanceof SettingsHelper.FileSettingsItem) { + FileSettingsItem fileItem = (FileSettingsItem) item; + if (fileItem.getSubtype() == FileSettingsItem.FileSubtype.RENDERING_STYLE) { + plugin.addRenderer(fileItem.getName()); + } else if (fileItem.getSubtype() == FileSettingsItem.FileSubtype.ROUTING_CONFIG) { + plugin.addRouter(fileItem.getName()); + } else if (fileItem.getSubtype() == FileSettingsItem.FileSubtype.OTHER) { + plugin.setResourceDirName(item.getFileName()); + } + } else if (item instanceof SuggestedDownloadsItem) { + plugin.updateSuggestedDownloads(((SuggestedDownloadsItem) item).getItems()); } - } else if (item instanceof SuggestedDownloadsItem) { - customPlugin.updateSuggestedDownloads(((SuggestedDownloadsItem) item).items); } + OsmandPlugin.addCustomPlugin(app, plugin); } }