commit
da84ed2866
2 changed files with 10 additions and 4 deletions
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
|
@ -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()) {
|
||||||
|
|
Loading…
Reference in a new issue