- Timestamp:
- 2019-10-25T23:42:46+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/io/importexport/OsmExporter.java
r14982 r15474 66 66 * @param file Output file 67 67 * @param layer Data layer. Must be an instance of {@link OsmDataLayer}. 68 * @param noBackupif {@code true}, the potential backup file created if the output file already exists will be deleted69 * after a successful export68 * @param isAutosave if {@code true}, the potential backup file created if the output file already exists will be deleted 69 * after a successful export and post-save events won't be fired 70 70 * @throws IOException in case of IO errors 71 71 * @throws InvalidPathException when file name cannot be converted into a Path 72 72 * @throws IllegalArgumentException if {@code layer} is not an instance of {@code OsmDataLayer} 73 73 */ 74 public void exportData(File file, Layer layer, boolean noBackup) throws IOException {74 public void exportData(File file, Layer layer, boolean isAutosave) throws IOException { 75 75 if (!(layer instanceof OsmDataLayer)) { 76 76 throw new IllegalArgumentException( 77 77 MessageFormat.format("Expected instance of OsmDataLayer. Got ''{0}''.", layer.getClass().getName())); 78 78 } 79 save(file, (OsmDataLayer) layer, noBackup);79 save(file, (OsmDataLayer) layer, isAutosave); 80 80 } 81 81 … … 84 84 } 85 85 86 private void save(File file, OsmDataLayer layer, boolean noBackup) throws IOException {86 private void save(File file, OsmDataLayer layer, boolean isAutosave) throws IOException { 87 87 File tmpFile = null; 88 88 try { … … 99 99 100 100 doSave(file, layer); 101 if (( noBackup|| !Config.getPref().getBoolean("save.keepbackup", false)) && tmpFile != null) {101 if ((isAutosave || !Config.getPref().getBoolean("save.keepbackup", false)) && tmpFile != null) { 102 102 Utils.deleteFile(tmpFile); 103 103 } 104 layer.onPostSaveToFile(); 104 if (!isAutosave) { 105 layer.onPostSaveToFile(); 106 } 105 107 } catch (IOException | InvalidPathException e) { 106 108 Logging.error(e);
Note:
See TracChangeset
for help on using the changeset viewer.