mirror of
https://github.com/arduino/Arduino.git
synced 2024-11-29 10:24:12 +01:00
Deleting tab from IDE does not delete from temporary folder. Fixes #1161
This commit is contained in:
commit
69bc5369f3
@ -612,7 +612,7 @@ public class Sketch {
|
||||
|
||||
} else {
|
||||
// delete the file
|
||||
if (!current.deleteFile()) {
|
||||
if (!current.deleteFile(tempBuildFolder)) {
|
||||
Base.showMessage(_("Couldn't do it"),
|
||||
I18n.format(_("Could not delete \"{0}\"."), current.getFileName()));
|
||||
return;
|
||||
|
@ -107,8 +107,21 @@ public class SketchCode {
|
||||
}
|
||||
|
||||
|
||||
protected boolean deleteFile() {
|
||||
return file.delete();
|
||||
protected boolean deleteFile(File tempBuildFolder) {
|
||||
if (!file.delete()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
File[] compiledFiles = tempBuildFolder.listFiles(new FileFilter() {
|
||||
public boolean accept(File pathname) {
|
||||
return pathname.getName().startsWith(getFileName());
|
||||
}
|
||||
});
|
||||
for (File compiledFile : compiledFiles) {
|
||||
compiledFile.delete();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user