From 540c465d1b544f5ae50a32ecc4aef099af55d935 Mon Sep 17 00:00:00 2001 From: Siedlerchr Date: Mon, 25 Nov 2024 23:12:41 +0100 Subject: [PATCH] Fix file adding Fixes https://github.com/JabRef/jabref/issues/12236 Follow up to https://github.com/JabRef/jabref/pull/12219 --- .../jabref/gui/linkedfile/LinkedFileEditDialogViewModel.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/jabref/gui/linkedfile/LinkedFileEditDialogViewModel.java b/src/main/java/org/jabref/gui/linkedfile/LinkedFileEditDialogViewModel.java index 954c53a84b3..c360fe6e90f 100644 --- a/src/main/java/org/jabref/gui/linkedfile/LinkedFileEditDialogViewModel.java +++ b/src/main/java/org/jabref/gui/linkedfile/LinkedFileEditDialogViewModel.java @@ -119,6 +119,10 @@ void checkForBadFileNameAndAdd(Path fileToAdd) { dialogService.showErrorDialogAndWait(ex); } } + } else { + link.set(relativize(fileToAdd)); + filePreferences.setWorkingDirectory(fileToAdd); + setExternalFileTypeByExtension(link.getValueSafe()); } }