Merge pull request #8938 from osmandapp/fix_8908

Fix_8908
This commit is contained in:
max-klaus 2020-05-13 10:20:02 +03:00 committed by GitHub
commit da84ed2866
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View file

@ -291,8 +291,14 @@ public class SearchUICore {
return null; return null;
} }
public <T extends SearchCoreAPI> SearchResultCollection shallowSearch(Class<T> cl, public <T extends SearchCoreAPI> SearchResultCollection shallowSearch(Class<T> cl, String text,
String text, final ResultMatcher<SearchResult> matcher) throws IOException { ResultMatcher<SearchResult> matcher) throws IOException {
return shallowSearch(cl, text, matcher, true, true);
}
public <T extends SearchCoreAPI> SearchResultCollection shallowSearch(Class<T> cl, String text,
final ResultMatcher<SearchResult> matcher,
boolean resortAll, boolean removeDuplicates) throws IOException {
T api = getApiByClass(cl); T api = getApiByClass(cl);
if (api != null) { if (api != null) {
if (debugMode) { if (debugMode) {
@ -306,7 +312,7 @@ public class SearchUICore {
SearchResultCollection collection = new SearchResultCollection( SearchResultCollection collection = new SearchResultCollection(
sphrase); sphrase);
collection.addSearchResults(rm.getRequestResults(), true, true); collection.addSearchResults(rm.getRequestResults(), resortAll, removeDuplicates);
if (debugMode) { if (debugMode) {
LOG.info("Finish shallow search <" + sphrase + "> Results=" + rm.getRequestResults().size()); LOG.info("Finish shallow search <" + sphrase + "> Results=" + rm.getRequestResults().size());
} }

View file

@ -1507,7 +1507,7 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
private void reloadHistoryInternal() { private void reloadHistoryInternal() {
if (historySearchFragment != null) { if (historySearchFragment != null) {
try { try {
SearchResultCollection res = searchUICore.shallowSearch(SearchHistoryAPI.class, "", null); SearchResultCollection res = searchUICore.shallowSearch(SearchHistoryAPI.class, "", null, false, false);
List<QuickSearchListItem> rows = new ArrayList<>(); List<QuickSearchListItem> rows = new ArrayList<>();
if (res != null) { if (res != null) {
for (SearchResult sr : res.getCurrentSearchResults()) { for (SearchResult sr : res.getCurrentSearchResults()) {