mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-16 11:21:18 +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:
@ -707,21 +707,21 @@ 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
|
||||||
|
File mainFile = new File(getMainFilePath());
|
||||||
|
File mainFolder = mainFile.getParentFile();
|
||||||
|
File[] pdeFiles = mainFolder.listFiles(new FilenameFilter() {
|
||||||
|
public boolean accept(File dir, String name) {
|
||||||
|
return name.toLowerCase().endsWith(".pde");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// rename .pde files to .ino
|
if (pdeFiles != null && pdeFiles.length > 0) {
|
||||||
File mainFile = new File(getMainFilePath());
|
// Do rename of all .pde files to new .ino extension
|
||||||
File mainFolder = mainFile.getParentFile();
|
for (File pdeFile : pdeFiles)
|
||||||
File[] pdeFiles = mainFolder.listFiles(new FilenameFilter() {
|
renameCodeToInoExtension(pdeFile);
|
||||||
public boolean accept(File dir, String name) {
|
|
||||||
return name.toLowerCase().endsWith(".pde");
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
if (pdeFiles != null && pdeFiles.length > 0) {
|
|
||||||
// Do rename of all .pde files to new .ino extension
|
|
||||||
for (File pdeFile : pdeFiles)
|
|
||||||
renameCodeToInoExtension(pdeFile);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < codeCount; i++) {
|
for (int i = 0; i < codeCount; i++) {
|
||||||
|
Reference in New Issue
Block a user