1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-02-20 14:54:31 +01:00

Let SketchFile.delete() call Sketch.removeFile()

Previously, callers of `SketchFile.delete()` would also call
`Sketch.removeFile()`, but letting SketchFile handle this is more
robust.

This is possible now that SketchFile keeps a reference to Sketch and
makes updating the Sketch file list less fragile.

Eventually this might be further decoupled by letting SketchFile
broadcast a "deleted" event instead.
This commit is contained in:
Matthijs Kooijman 2015-12-29 17:04:53 +01:00 committed by Martino Facchin
parent aae0bc4c47
commit 1d15c434dc
2 changed files with 2 additions and 3 deletions

View File

@ -259,9 +259,6 @@ public class SketchController {
return;
}
// remove code from the list
sketch.removeFile(current);
// just set current tab to the main tab
editor.selectTab(0);

View File

@ -142,6 +142,8 @@ public class SketchFile {
}
}
sketch.removeFile(this);
return true;
}