mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-30 19:52:13 +01:00
Move SketchController.prepareDataFolder()
to Sketch
This commit is contained in:
parent
a4e2e80c1c
commit
a07a9ff895
@ -704,7 +704,7 @@ public class SketchController {
|
||||
if (FileUtils.hasExtension(sourceFile, Sketch.EXTENSIONS)) {
|
||||
destFile = new File(sketch.getFolder(), filename);
|
||||
} else {
|
||||
prepareDataFolder();
|
||||
sketch.prepareDataFolder();
|
||||
destFile = new File(sketch.getDataFolder(), filename);
|
||||
isData = true;
|
||||
}
|
||||
@ -1044,16 +1044,6 @@ public class SketchController {
|
||||
|
||||
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
/**
|
||||
* Create the data folder if it does not exist already. As a convenience,
|
||||
* it also returns the data folder, since it's likely about to be used.
|
||||
*/
|
||||
private File prepareDataFolder() {
|
||||
if (!sketch.getDataFolder().exists()) {
|
||||
sketch.getDataFolder().mkdirs();
|
||||
}
|
||||
return sketch.getDataFolder();
|
||||
}
|
||||
|
||||
|
||||
private void setUntitled(boolean u) {
|
||||
|
@ -140,6 +140,18 @@ public class Sketch {
|
||||
return new ArrayList<>(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the data folder if it does not exist already. As a
|
||||
* convenience, it also returns the data folder, since it's likely
|
||||
* about to be used.
|
||||
*/
|
||||
public File prepareDataFolder() {
|
||||
if (!dataFolder.exists()) {
|
||||
dataFolder.mkdirs();
|
||||
}
|
||||
return dataFolder;
|
||||
}
|
||||
|
||||
public void save() throws IOException {
|
||||
for (SketchCode code : getCodes()) {
|
||||
if (code.isModified())
|
||||
|
Loading…
x
Reference in New Issue
Block a user