Merge pull request #6066 from osmandapp/Fix_5975

Fix 5975
This commit is contained in:
vshcherb 2018-09-19 13:44:26 +02:00 committed by GitHub
commit c68b154987
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View file

@ -67,4 +67,5 @@ public class IndexConstants {
public static final String VOICE_INDEX_DIR = "voice/"; //$NON-NLS-1$ public static final String VOICE_INDEX_DIR = "voice/"; //$NON-NLS-1$
public static final String RENDERERS_DIR = "rendering/"; //$NON-NLS-1$ public static final String RENDERERS_DIR = "rendering/"; //$NON-NLS-1$
public static final String ROUTING_XML_FILE= "routing.xml"; public static final String ROUTING_XML_FILE= "routing.xml";
public static final String SETTINGS_DIR = "settings/"; //$NON-NLS-1$
} }

View file

@ -335,8 +335,8 @@ public class AppInitializer implements IProgress {
} }
private void initPoiTypes() { private void initPoiTypes() {
if(app.getAppPath("poi_types.xml").exists()) { if (app.getAppPath(IndexConstants.SETTINGS_DIR + "poi_types.xml").exists()) {
app.poiTypes.init(app.getAppPath("poi_types.xml").getAbsolutePath()); app.poiTypes.init(app.getAppPath(IndexConstants.SETTINGS_DIR + "poi_types.xml").getAbsolutePath());
} else { } else {
app.poiTypes.init(); app.poiTypes.init();
} }

View file

@ -497,7 +497,7 @@ public class ResourceManager {
private void copyPoiTypes() { private void copyPoiTypes() {
try { try {
File file = context.getAppPath("poi_types.xml"); File file = context.getAppPath(IndexConstants.SETTINGS_DIR + "poi_types.xml");
if (file != null) { if (file != null) {
FileOutputStream fout = new FileOutputStream(file); FileOutputStream fout = new FileOutputStream(file);
Algorithms.streamCopy(MapPoiTypes.class.getResourceAsStream("poi_types.xml"), fout); Algorithms.streamCopy(MapPoiTypes.class.getResourceAsStream("poi_types.xml"), fout);