mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-18 12:54:25 +01:00
Refactored Base.getDefaultSketchbookFolder() method.
This commit is contained in:
parent
20582630a5
commit
26a8b37d18
@ -222,7 +222,7 @@ public class Base {
|
||||
|
||||
// If no path is set, get the default sketchbook folder for this platform
|
||||
if (sketchbookPath == null) {
|
||||
File defaultFolder = getDefaultSketchbookFolder();
|
||||
File defaultFolder = getDefaultSketchbookFolderOrPromptForIt();
|
||||
if (BaseNoGui.getPortableFolder() != null)
|
||||
Preferences.set("sketchbook.path", BaseNoGui.getPortableSketchbookFolder());
|
||||
else
|
||||
@ -1896,6 +1896,14 @@ public class Base {
|
||||
sketchbookFolder = getPlatform().getDefaultSketchbookFolder();
|
||||
} catch (Exception e) { }
|
||||
|
||||
return sketchbookFolder;
|
||||
}
|
||||
|
||||
|
||||
protected File getDefaultSketchbookFolderOrPromptForIt() {
|
||||
|
||||
File sketchbookFolder = getDefaultSketchbookFolder();
|
||||
|
||||
if (sketchbookFolder == null) {
|
||||
sketchbookFolder = promptSketchbookLocation();
|
||||
}
|
||||
|
@ -578,7 +578,7 @@ public class Preferences {
|
||||
String newPath = sketchbookLocationField.getText();
|
||||
if (newPath.isEmpty()) {
|
||||
if (Base.getPortableFolder() == null)
|
||||
newPath = editor.base.getDefaultSketchbookFolder().toString();
|
||||
newPath = editor.base.getDefaultSketchbookFolderOrPromptForIt().toString();
|
||||
else
|
||||
newPath = Base.getPortableSketchbookFolder();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user