Remove local wiki category from search
This commit is contained in:
parent
4b45f3a43e
commit
0f1b90c1b8
3 changed files with 5 additions and 23 deletions
|
@ -731,6 +731,7 @@ public class SearchCoreFactory {
|
||||||
if (translatedNames.isEmpty()) {
|
if (translatedNames.isEmpty()) {
|
||||||
translatedNames = types.getAllTranslatedNames(false);
|
translatedNames = types.getAllTranslatedNames(false);
|
||||||
topVisibleFilters = types.getTopVisibleFilters();
|
topVisibleFilters = types.getTopVisibleFilters();
|
||||||
|
topVisibleFilters.remove(types.getOsmwiki());
|
||||||
categories = types.getCategories(false);
|
categories = types.getCategories(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,6 @@ public class PoiFiltersHelper {
|
||||||
private PoiUIFilter searchByNamePOIFilter;
|
private PoiUIFilter searchByNamePOIFilter;
|
||||||
private PoiUIFilter customPOIFilter;
|
private PoiUIFilter customPOIFilter;
|
||||||
private PoiUIFilter showAllPOIFilter;
|
private PoiUIFilter showAllPOIFilter;
|
||||||
private PoiUIFilter localWikiPoiFilter;
|
|
||||||
private PoiUIFilter topWikiPoiFilter;
|
private PoiUIFilter topWikiPoiFilter;
|
||||||
private List<PoiUIFilter> cacheTopStandardFilters;
|
private List<PoiUIFilter> cacheTopStandardFilters;
|
||||||
private Set<PoiUIFilter> selectedPoiFilters = new TreeSet<>();
|
private Set<PoiUIFilter> selectedPoiFilters = new TreeSet<>();
|
||||||
|
@ -120,20 +119,6 @@ public class PoiFiltersHelper {
|
||||||
return customPOIFilter;
|
return customPOIFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PoiUIFilter getLocalWikiPOIFilter() {
|
|
||||||
if (localWikiPoiFilter == null) {
|
|
||||||
PoiType place = application.getPoiTypes().getPoiTypeByKey(WIKI_PLACE);
|
|
||||||
if (place != null && !Algorithms.isEmpty(application.getLanguage())) {
|
|
||||||
PoiUIFilter filter = new PoiUIFilter(place, application, " " +
|
|
||||||
application.getLangTranslation(application.getLanguage()));
|
|
||||||
filter.setSavedFilterByName("wiki:lang:" + application.getLanguage());
|
|
||||||
filter.setStandardFilter(true);
|
|
||||||
localWikiPoiFilter = filter;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return localWikiPoiFilter;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void prepareTopWikiFilter(@NonNull PoiUIFilter wiki) {
|
public void prepareTopWikiFilter(@NonNull PoiUIFilter wiki) {
|
||||||
boolean prepareByDefault = true;
|
boolean prepareByDefault = true;
|
||||||
Bundle wikiSettings = WikipediaPoiMenu.getWikiPoiSettings(application);
|
Bundle wikiSettings = WikipediaPoiMenu.getWikiPoiSettings(application);
|
||||||
|
@ -217,8 +202,7 @@ public class PoiFiltersHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PoiUIFilter ff = getFilterById(filterId, getCustomPOIFilter(), getSearchByNamePOIFilter(),
|
PoiUIFilter ff = getFilterById(filterId, getCustomPOIFilter(), getSearchByNamePOIFilter(),
|
||||||
getTopWikiPoiFilter(), getLocalWikiPOIFilter(), getShowAllPOIFilter(),
|
getTopWikiPoiFilter(), getShowAllPOIFilter(), getNominatimPOIFilter(), getNominatimAddressFilter());
|
||||||
getNominatimPOIFilter(), getNominatimAddressFilter());
|
|
||||||
if (ff != null) {
|
if (ff != null) {
|
||||||
return ff;
|
return ff;
|
||||||
}
|
}
|
||||||
|
@ -284,9 +268,6 @@ public class PoiFiltersHelper {
|
||||||
top = new ArrayList<>();
|
top = new ArrayList<>();
|
||||||
// user defined
|
// user defined
|
||||||
top.addAll(getUserDefinedPoiFilters(true));
|
top.addAll(getUserDefinedPoiFilters(true));
|
||||||
if (getLocalWikiPOIFilter() != null) {
|
|
||||||
top.add(getLocalWikiPOIFilter());
|
|
||||||
}
|
|
||||||
// default
|
// default
|
||||||
MapPoiTypes poiTypes = application.getPoiTypes();
|
MapPoiTypes poiTypes = application.getPoiTypes();
|
||||||
for (AbstractPoiType t : poiTypes.getTopVisibleFilters()) {
|
for (AbstractPoiType t : poiTypes.getTopVisibleFilters()) {
|
||||||
|
|
|
@ -111,9 +111,9 @@ public class QuickSearchHelper implements ResourceListener {
|
||||||
for (CustomSearchPoiFilter udf : poiFilters.getUserDefinedPoiFilters(false)) {
|
for (CustomSearchPoiFilter udf : poiFilters.getUserDefinedPoiFilters(false)) {
|
||||||
core.addCustomSearchPoiFilter(udf, 0);
|
core.addCustomSearchPoiFilter(udf, 0);
|
||||||
}
|
}
|
||||||
PoiUIFilter localWikiPoiFilter = poiFilters.getLocalWikiPOIFilter();
|
PoiUIFilter topWikiPoiFilter = poiFilters.getTopWikiPoiFilter();
|
||||||
if (localWikiPoiFilter != null) {
|
if (topWikiPoiFilter != null) {
|
||||||
core.addCustomSearchPoiFilter(localWikiPoiFilter, 1);
|
core.addCustomSearchPoiFilter(topWikiPoiFilter, 1);
|
||||||
}
|
}
|
||||||
core.addCustomSearchPoiFilter(poiFilters.getShowAllPOIFilter(), 1);
|
core.addCustomSearchPoiFilter(poiFilters.getShowAllPOIFilter(), 1);
|
||||||
refreshFilterOrders();
|
refreshFilterOrders();
|
||||||
|
|
Loading…
Reference in a new issue