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:
parent
aae0bc4c47
commit
1d15c434dc
@ -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);
|
||||
|
||||
|
@ -142,6 +142,8 @@ public class SketchFile {
|
||||
}
|
||||
}
|
||||
|
||||
sketch.removeFile(this);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user