Skip to content

Commit

Permalink
Rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
LoayGhreeb committed Sep 1, 2024
1 parent bb1d8c5 commit 68d1df8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
7 changes: 0 additions & 7 deletions src/main/java/org/jabref/gui/StateManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,6 @@ public Optional<SearchResults> getSearchResults(BibDatabaseContext databaseConte
return Optional.ofNullable(searchResults.get(databaseContext.getUid()));
}

public int getSearchResultsCount() {
return activeDatabase.get()
.flatMap(this::getSearchResults)
.map(SearchResults::getNumberOfResults)
.orElse(0);
}

public List<String> collectAllDatabasePaths() {
List<String> list = new ArrayList<>();
getOpenDatabases().stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private void updateSearchMatches(Optional<SearchQuery> query) {
SearchResults searchResults = new SearchResults();
for (BibDatabaseContext context : stateManager.getOpenDatabases()) {
stateManager.getLuceneManager(context).ifPresent(luceneManager -> {
searchResults.addSearchResults(luceneManager.search(query.get()));
searchResults.mergeSearchResults(luceneManager.search(query.get()));
});
}
for (BibEntryTableViewModel entry : entriesViewModel) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/jabref/model/search/SearchResults.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public class SearchResults {

private final Map<BibEntry, List<SearchResult>> searchResults = new HashMap<>();

public void addSearchResults(SearchResults newResults) {
this.searchResults.putAll(newResults.searchResults);
public void mergeSearchResults(SearchResults additionalResults) {
this.searchResults.putAll(additionalResults.searchResults);
}

public void addSearchResult(BibEntry entry, SearchResult result) {
Expand Down

0 comments on commit 68d1df8

Please sign in to comment.