Ticket #12390: RenameLayerConfirmOverwrite.patch

File RenameLayerConfirmOverwrite.patch, 748 bytes (added by kolesar, 5 years ago)
  • src/org/openstreetmap/josm/actions/RenameLayerAction.java

    diff --git a/src/org/openstreetmap/josm/actions/RenameLayerAction.java b/src/org/openstreetmap/josm/actions/RenameLayerAction.java
    index b5bd308..7d0cd3d 100644
    a b public class RenameLayerAction extends AbstractAction { 
    8383                    newname += oldname.substring(oldname.lastIndexOf('.'));
    8484                }
    8585                File newFile = new File(newname);
     86                if (!SaveActionBase.confirmOverwrite(newFile)) return;
    8687                if (Main.platform.rename(file, newFile)) {
    8788                    layer.setAssociatedFile(newFile);
    8889                    nameText = newFile.getName();