Fix compilation

This commit is contained in:
Victor Shcherb 2020-06-04 16:07:38 +02:00
parent a2c04cd48a
commit ac7e1d4436
3 changed files with 15 additions and 16 deletions

View file

@ -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)) {

View file

@ -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())) {

View file

@ -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);
}
}