From 4a52c012f4d81d60c5dbf85ced90ecb52fe3ba68 Mon Sep 17 00:00:00 2001 From: Siedlerchr Date: Mon, 9 Sep 2024 10:10:15 +0200 Subject: [PATCH 1/9] Add option to disable keeping download url Refs https://discourse.jabref.org/t/import-adds-pdf-link-and-url-to-file-entry/4484/ --- .../linkedfile/DownloadLinkedFileAction.java | 3 ++- .../gui/preferences/websearch/WebSearchTab.fxml | 1 + .../websearch/WebSearchTabViewModel.java | 5 +++-- .../org/jabref/preferences/FilePreferences.java | 17 ++++++++++++++++- .../jabref/preferences/JabRefPreferences.java | 6 +++++- src/main/resources/l10n/JabRef_en.properties | 1 + 6 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/jabref/gui/linkedfile/DownloadLinkedFileAction.java b/src/main/java/org/jabref/gui/linkedfile/DownloadLinkedFileAction.java index 490da28bdca..1b20439e121 100644 --- a/src/main/java/org/jabref/gui/linkedfile/DownloadLinkedFileAction.java +++ b/src/main/java/org/jabref/gui/linkedfile/DownloadLinkedFileAction.java @@ -171,7 +171,8 @@ private void onSuccess(Path targetDirectory, Path downloadedFile) { } if (linkedFile.getSourceUrl().isEmpty() && LinkedFile.isOnlineLink(linkedFile.getLink())) { newLinkedFile.setSourceURL(linkedFile.getLink()); - } else { + } else if (filePreferences.shouldKeepDownloadUrl()) { + // Add pref check to not store source URL newLinkedFile.setSourceURL(linkedFile.getSourceUrl()); } diff --git a/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.fxml b/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.fxml index 57cd5a4a449..463debd9327 100644 --- a/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.fxml @@ -20,6 +20,7 @@ +