From f31ad60d471870a66b70f90a1f4c8224dd29bf32 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 9 Dec 2020 16:29:59 +0200 Subject: [PATCH] travel constant fix --- OsmAnd/src/net/osmand/plus/resources/ResourceManager.java | 2 +- .../src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index c8b5bdec16..9dca53fe40 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -1138,7 +1138,7 @@ public class ResourceManager { Collection fileReaders = getFileReaders(); List readers = new ArrayList<>(fileReaders.size()); for (BinaryMapReaderResource res : fileReaders) { - if (!res.filename.toString().toLowerCase().contains("wiki")) { + if (!res.filename.toString().toLowerCase().contains("travel.obf")) { continue; } BinaryMapIndexReader index = res.getReader(BinaryMapReaderResourceType.POI); diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index eb7e3b3d09..b5952de7c7 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -1,7 +1,6 @@ package net.osmand.plus.wikivoyage.data; import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import net.osmand.Collator; import net.osmand.CollatorStringMatcher; @@ -66,7 +65,7 @@ public class TravelObfHelper implements TravelHelper { File[] files = app.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR).listFiles(); if (files != null) { for (File f : files) { - if (f.getName().equals(WIKIVOYAGE_OBF)) { + if (f.getName().equals(WIKIVOYAGE_OBF) || f.getName().contains("travel.obf")) { return true; } } @@ -127,7 +126,6 @@ public class TravelObfHelper implements TravelHelper { @NonNull @Override public List search(String searchQuery) { - List res = new ArrayList<>(); CollatorStringMatcher matcher = new CollatorStringMatcher(searchQuery, CollatorStringMatcher.StringMatcherMode.CHECK_STARTS_FROM_SPACE);