1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-17 22:23:10 +03:00

Don't rename read-only files in sketch on save (which becomes save-as).

http://code.google.com/p/arduino/issues/detail?id=639
This commit is contained in:
David A. Mellis
2011-09-16 12:45:24 -04:00
parent f77de7e8c0
commit 026794f1eb

View File

@ -707,8 +707,7 @@ public class Sketch {
"need to re-save this sketch to another location."); "need to re-save this sketch to another location.");
// if the user cancels, give up on the save() // if the user cancels, give up on the save()
if (!saveAs()) return false; if (!saveAs()) return false;
} } else {
// rename .pde files to .ino // rename .pde files to .ino
File mainFile = new File(getMainFilePath()); File mainFile = new File(getMainFilePath());
File mainFolder = mainFile.getParentFile(); File mainFolder = mainFile.getParentFile();
@ -723,6 +722,7 @@ public class Sketch {
for (File pdeFile : pdeFiles) for (File pdeFile : pdeFiles)
renameCodeToInoExtension(pdeFile); renameCodeToInoExtension(pdeFile);
} }
}
for (int i = 0; i < codeCount; i++) { for (int i = 0; i < codeCount; i++) {
if (code[i].isModified()) if (code[i].isModified())