diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e0063dec6c..6f0f409ca3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - We fixed an issue where imports to a custom group would only work for the first entry [#11085](https://github.com/JabRef/jabref/issues/11085), [#11269](https://github.com/JabRef/jabref/issues/11269) - We fixed an issue where a new entry was not added to the selected group [#8933](https://github.com/JabRef/jabref/issues/8933) - We fixed an issue where the horizontal position of the Entry Preview inside the entry editor was not remembered across restarts [#11281](https://github.com/JabRef/jabref/issues/11281) +- We fixed an issue where the search index was not updated after linking PDF files. [#11317](https://github.com/JabRef/jabref/pull/11317) - We fixed an issue where the entry editor context menu was not shown correctly when JabRef is opened on a second, extended screen [#11323](https://github.com/JabRef/jabref/issues/11323), [#11174](https://github.com/JabRef/jabref/issues/11174) ### Removed diff --git a/src/main/java/org/jabref/gui/LibraryTab.java b/src/main/java/org/jabref/gui/LibraryTab.java index ff2c9e4ba20..a8414a90d59 100644 --- a/src/main/java/org/jabref/gui/LibraryTab.java +++ b/src/main/java/org/jabref/gui/LibraryTab.java @@ -308,6 +308,7 @@ private void setDatabaseContext(BibDatabaseContext bibDatabaseContext) { setupMainPanel(); setupAutoCompletion(); + this.getDatabase().registerListener(new IndexUpdateListener()); this.getDatabase().registerListener(new EntriesRemovedListener()); // ensure that at each addition of a new entry, the entry is added to the groups interface @@ -1085,9 +1086,9 @@ public void listen(FieldChangedEvent fieldChangedEvent) { List newFileList = FileFieldParser.parse(fieldChangedEvent.getNewValue()); List addedFiles = new ArrayList<>(newFileList); - addedFiles.remove(oldFileList); + addedFiles.removeAll(oldFileList); List removedFiles = new ArrayList<>(oldFileList); - removedFiles.remove(newFileList); + removedFiles.removeAll(newFileList); try { PdfIndexer indexer = PdfIndexerManager.getIndexer(bibDatabaseContext, preferencesService.getFilePreferences()); diff --git a/src/main/java/org/jabref/model/database/BibDatabaseContext.java b/src/main/java/org/jabref/model/database/BibDatabaseContext.java index f8d4c3dfdcf..058a238187d 100644 --- a/src/main/java/org/jabref/model/database/BibDatabaseContext.java +++ b/src/main/java/org/jabref/model/database/BibDatabaseContext.java @@ -255,8 +255,8 @@ public Path getFulltextIndexPath() { Path indexPath; if (getDatabasePath().isPresent()) { - Path databaseFileName = getDatabasePath().get().getFileName(); - String fileName = BackupFileUtil.getUniqueFilePrefix(databaseFileName) + "--" + databaseFileName; + Path databasePath = getDatabasePath().get(); + String fileName = BackupFileUtil.getUniqueFilePrefix(databasePath) + "--" + databasePath.getFileName(); indexPath = appData.resolve(fileName); LOGGER.debug("Index path for {} is {}", getDatabasePath().get(), indexPath); return indexPath;