From ac7e1d4436d67419342199c2ff6a015782878aa6 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 4 Jun 2020 16:07:38 +0200 Subject: [PATCH] Fix compilation --- .../main/java/net/osmand/search/SearchUICore.java | 2 -- .../plus/search/QuickSearchDialogFragment.java | 15 ++++++++------- .../net/osmand/plus/search/QuickSearchHelper.java | 14 +++++++------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java b/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java index adcc6f5484..e23e8a87ac 100644 --- a/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java +++ b/OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java @@ -713,7 +713,6 @@ public class SearchUICore { @Override public boolean publish(SearchResult object) { - // TODO Check names and count first , other? if (phrase != null && object.otherNames != null && !phrase.getFirstUnknownNameStringMatcher().matches(object.localeName)) { for (String s : object.otherNames) { if (phrase.getFirstUnknownNameStringMatcher().matches(s)) { @@ -721,7 +720,6 @@ public class SearchUICore { break; } } - // TODO if (Algorithms.isEmpty(object.alternateName) && object.object instanceof Amenity) { for (String value : ((Amenity) object.object).getAdditionalInfo().values()) { if (phrase.getFirstUnknownNameStringMatcher().matches(value)) { diff --git a/OsmAnd/src/net/osmand/plus/search/QuickSearchDialogFragment.java b/OsmAnd/src/net/osmand/plus/search/QuickSearchDialogFragment.java index a18cbc8169..0649bd3363 100644 --- a/OsmAnd/src/net/osmand/plus/search/QuickSearchDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/search/QuickSearchDialogFragment.java @@ -359,13 +359,14 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC filter = app.getPoiFilters().getNominatimPOIFilter(); filter.setFilterByName(searchPhrase.getUnknownSearchPhrase()); filter.clearCurrentResults(); - } else if (searchPhrase.hasUnknownSearchWordPoiType()) { - AbstractPoiType pt = searchPhrase.getUnknownSearchWordPoiType(); - filter = new PoiUIFilter(pt, app, ""); - String customName = searchPhrase.getPoiNameFilter(); - if (!Algorithms.isEmpty(customName)) { - filter.setFilterByName(customName); - } + // TODO Alexey +// } else if (searchPhrase.hasUnknownSearchWordPoiType()) { +// AbstractPoiType pt = searchPhrase.getUnknownSearchWordPoiType(); +// filter = new PoiUIFilter(pt, app, ""); +// String customName = searchPhrase.getPoiNameFilter(); +// if (!Algorithms.isEmpty(customName)) { +// filter.setFilterByName(customName); +// } } else { filter = app.getPoiFilters().getSearchByNamePOIFilter(); if (!Algorithms.isEmpty(searchPhrase.getFirstUnknownSearchWord())) { diff --git a/OsmAnd/src/net/osmand/plus/search/QuickSearchHelper.java b/OsmAnd/src/net/osmand/plus/search/QuickSearchHelper.java index b496ea3650..c0fe0f49a2 100644 --- a/OsmAnd/src/net/osmand/plus/search/QuickSearchHelper.java +++ b/OsmAnd/src/net/osmand/plus/search/QuickSearchHelper.java @@ -201,9 +201,9 @@ public class QuickSearchHelper implements ResourceListener { //sr.localeRelatedObjectName = app.getRegions().getCountryName(sr.location); sr.relatedObject = selectedGpx.getGpxFile(); sr.preferredZoom = 17; - if (phrase.getUnknownSearchWordLength() <= 1 && phrase.isNoSelectedType()) { + if (phrase.getFirstUnknownSearchWord().length() <= 1 && phrase.isNoSelectedType()) { resultMatcher.publish(sr); - } else if (phrase.getNameStringMatcher().matches(sr.localeName)) { + } else if (phrase.getFirstUnknownNameStringMatcher().matches(sr.localeName)) { resultMatcher.publish(sr); } } @@ -249,7 +249,7 @@ public class QuickSearchHelper implements ResourceListener { sr.priority = SEARCH_FAVORITE_CATEGORY_PRIORITY; sr.objectType = ObjectType.FAVORITE_GROUP; sr.preferredZoom = 17; - if (phrase.getNameStringMatcher().matches(sr.localeName)) { + if (phrase.getFirstUnknownNameStringMatcher().matches(sr.localeName)) { if (group.getPoints().size() < 5) { for (FavouritePoint point : group.getPoints()) { SearchResult srp = new SearchResult(phrase); @@ -313,10 +313,10 @@ public class QuickSearchHelper implements ResourceListener { continue; } } - if (phrase.getUnknownSearchWordLength() <= 1 + if (phrase.getFirstUnknownSearchWord().length() <= 1 && (phrase.isNoSelectedType() || phrase.isLastWord(ObjectType.FAVORITE_GROUP))) { resultMatcher.publish(sr); - } else if (phrase.getNameStringMatcher().matches(sr.localeName)) { + } else if (phrase.getFirstUnknownNameStringMatcher().matches(sr.localeName)) { resultMatcher.publish(sr); } } @@ -457,9 +457,9 @@ public class QuickSearchHelper implements ResourceListener { } if (publish) { sr.priority = SEARCH_HISTORY_OBJECT_PRIORITY + (p++); - if (phrase.getUnknownSearchWordLength() <= 1 && phrase.isNoSelectedType()) { + if (phrase.getFirstUnknownSearchWord().length() <= 1 && phrase.isNoSelectedType()) { resultMatcher.publish(sr); - } else if (phrase.getNameStringMatcher().matches(sr.localeName)) { + } else if (phrase.getFirstUnknownNameStringMatcher().matches(sr.localeName)) { resultMatcher.publish(sr); } }