From d8b74822439b9a5f11f343764a28e2d3a76dd22d Mon Sep 17 00:00:00 2001 From: "predrag.milanovicMin" Date: Tue, 11 Jul 2017 10:44:06 +0200 Subject: [PATCH 1/5] Shutdown previus AutosaveManager and BackupManager --- src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java b/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java index f12e63492a3..c1cff33ec09 100644 --- a/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java +++ b/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java @@ -325,6 +325,10 @@ public void saveAs(File file) throws Exception { .putAllDBMSConnectionProperties(properties); } + // close previous AutosaveManager and BackupManager + AutosaveManager.shutdown(context); + BackupManager.shutdown(context); + context.setDatabaseFile(file); if (file.getParent() != null) { Globals.prefs.put(JabRefPreferences.WORKING_DIRECTORY, file.getParent()); From 150b4d1e1c37cc8ad698536b058d47a7ec49002a Mon Sep 17 00:00:00 2001 From: "predrag.milanovicMin" Date: Tue, 11 Jul 2017 10:51:49 +0200 Subject: [PATCH 2/5] Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bdae58da4e..149b2baab5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We improved the duplicate checker such that different editions of the same publication are not marked as duplicates. [2960](https://github.com/JabRef/jabref/issues/2960) ### Fixed +- We fixed the a bug that leaves .sav file after SaveAs [#2947] - We fixed the function "Edit - Copy BibTeX key and link" to pass a hyperlink rather than an HTML statement. - We fixed the adding of a new entry from DOI which led to a connection error. The DOI resolution now uses HTTPS to protect the user's privacy.[#2879](https://github.com/JabRef/jabref/issues/2897) - We fixed the IEEE Xplore web search functionality [#2789](https://github.com/JabRef/jabref/issues/2789) From 17adc49f3943c40b4906bc782d92c8a828efb0de Mon Sep 17 00:00:00 2001 From: "predrag.milanovicMin" Date: Tue, 11 Jul 2017 15:12:03 +0200 Subject: [PATCH 3/5] closing AutosaveManager and BackupManager for original library --- .../jabref/gui/exporter/SaveDatabaseAction.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java b/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java index c1cff33ec09..76f5aafbb3c 100644 --- a/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java +++ b/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java @@ -316,7 +316,8 @@ public void saveAs() throws Exception { */ public void saveAs(File file) throws Exception { BibDatabaseContext context = panel.getBibDatabaseContext(); - + Path oldFile = context.getDatabasePath().get(); + if (context.getLocation() == DatabaseLocation.SHARED) { // Save all properties dependent on the ID. This makes it possible to restore them. DBMSConnectionProperties properties = context.getDBMSSynchronizer().getDBProcessor() @@ -325,10 +326,6 @@ public void saveAs(File file) throws Exception { .putAllDBMSConnectionProperties(properties); } - // close previous AutosaveManager and BackupManager - AutosaveManager.shutdown(context); - BackupManager.shutdown(context); - context.setDatabaseFile(file); if (file.getParent() != null) { Globals.prefs.put(JabRefPreferences.WORKING_DIRECTORY, file.getParent()); @@ -338,8 +335,14 @@ public void saveAs(File file) throws Exception { if (!success) { return; } - // Register so we get notifications about outside changes to the file. + //closing AutosaveManager and BackupManager for original library + context.setDatabaseFile(oldFile.toFile()); + AutosaveManager.shutdown(context); + BackupManager.shutdown(context); + context.setDatabaseFile(file); + + // Register so we get notifications about outside changes to the file. try { panel.setFileMonitorHandle(Globals.getFileUpdateMonitor().addUpdateListener(panel, context.getDatabaseFile().orElse(null))); From 0e2fbbf833223143267e399f953113496f5ce6d9 Mon Sep 17 00:00:00 2001 From: "predrag.milanovicMin" Date: Fri, 14 Jul 2017 15:58:07 +0200 Subject: [PATCH 4/5] Corrected text in CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 149b2baab5b..b3e438b5d01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,7 +29,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We improved the duplicate checker such that different editions of the same publication are not marked as duplicates. [2960](https://github.com/JabRef/jabref/issues/2960) ### Fixed -- We fixed the a bug that leaves .sav file after SaveAs [#2947] +- We fixed a bug that leaves .sav file after SaveAs [#2947] (https://github.com/JabRef/jabref/issues/2947) - We fixed the function "Edit - Copy BibTeX key and link" to pass a hyperlink rather than an HTML statement. - We fixed the adding of a new entry from DOI which led to a connection error. The DOI resolution now uses HTTPS to protect the user's privacy.[#2879](https://github.com/JabRef/jabref/issues/2897) - We fixed the IEEE Xplore web search functionality [#2789](https://github.com/JabRef/jabref/issues/2789) From 5c346b1da5640c9bfc45c6df2cb3fc2b3218f777 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Fri, 14 Jul 2017 23:35:39 +0200 Subject: [PATCH 5/5] Fix space --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3e438b5d01..8569a797daf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,7 +29,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We improved the duplicate checker such that different editions of the same publication are not marked as duplicates. [2960](https://github.com/JabRef/jabref/issues/2960) ### Fixed -- We fixed a bug that leaves .sav file after SaveAs [#2947] (https://github.com/JabRef/jabref/issues/2947) +- We fixed a bug that leaves .sav file after SaveAs [#2947](https://github.com/JabRef/jabref/issues/2947) - We fixed the function "Edit - Copy BibTeX key and link" to pass a hyperlink rather than an HTML statement. - We fixed the adding of a new entry from DOI which led to a connection error. The DOI resolution now uses HTTPS to protect the user's privacy.[#2879](https://github.com/JabRef/jabref/issues/2897) - We fixed the IEEE Xplore web search functionality [#2789](https://github.com/JabRef/jabref/issues/2789)