mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-14 11:29:26 +01:00
Stopping you from renaming the main / first sketch file (.pde) if it contains a .cpp file with the new name.
This commit is contained in:
parent
a59900692a
commit
a5b9d31134
@ -407,6 +407,19 @@ public class Sketch {
|
|||||||
"You can't have a .cpp file with the same name as the sketch.");
|
"You can't have a .cpp file with the same name as the sketch.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (currentIndex == 0) {
|
||||||
|
for (int i = 1; i < codeCount; i++) {
|
||||||
|
if (sanitaryName.equalsIgnoreCase(code[i].getPrettyName()) &&
|
||||||
|
code[i].getExtension().equalsIgnoreCase("cpp")) {
|
||||||
|
Base.showMessage("Nope",
|
||||||
|
"You can't rename the sketch to \"" + sanitaryName + "\"\n" +
|
||||||
|
"because the sketch already has a .cpp file with that name.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
File newFile = new File(folder, newName);
|
File newFile = new File(folder, newName);
|
||||||
// if (newFile.exists()) { // yay! users will try anything
|
// if (newFile.exists()) { // yay! users will try anything
|
||||||
|
Loading…
x
Reference in New Issue
Block a user