Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix libraries not being remembered when an unsaved library is discarded upon closing JabRef #9250

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We fixed an issue where an exception was not logged correctly. [koppor#627](https://github.com/JabRef/koppor/issues/627)
- We fixed an issue where hitting enter on the search field within the preferences dialog closed the dialog. [koppor#630](https://github.com/koppor/jabref/issues/630)
- We fixed a typo within a connection error message. [koppor#625](https://github.com/koppor/jabref/issues/625)
- We fixed an issue where JabRef forgets opened libraries [#9190](https://github.com/JabRef/jabref/issues/9190)

### Removed

Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ private void tearDownJabRef(List<String> filenames) {
Path focusedDatabase = getCurrentLibraryTab().getBibDatabaseContext()
.getDatabasePath()
.orElse(null);

prefs.getGuiPreferences().setLastFilesOpened(filenames);
prefs.getGuiPreferences().setLastFocusedFile(focusedDatabase);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/jabref/preferences/JabRefPreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -2573,7 +2573,9 @@ public GuiPreferences getGuiPreferences() {
if (newValue != null) {
put(LAST_FOCUSED, newValue.toAbsolutePath().toString());
} else {
remove(LAST_EDITED);
if (guiPreferences.getLastFilesOpened().isEmpty()) {
remove(LAST_EDITED);
}
}
});
guiPreferences.getFileHistory().addListener((InvalidationListener) change -> storeFileHistory(guiPreferences.getFileHistory()));
Expand Down