1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-18 07:52:14 +01:00

Moved portableSketchbookFolder from Base to BaseNoGui.

This commit is contained in:
Claudio Indellicati 2014-08-26 11:48:25 +02:00 committed by Cristian Maglie
parent 10af59f6fa
commit 20582630a5
2 changed files with 9 additions and 5 deletions

View File

@ -94,8 +94,6 @@ public class Base {
List<Editor> editors = Collections.synchronizedList(new ArrayList<Editor>());
Editor activeEditor;
static final String portableSketchbookFolder = "sketchbook";
static public void main(String args[]) throws Exception {
BaseNoGui.initLogger();
@ -226,7 +224,7 @@ public class Base {
if (sketchbookPath == null) {
File defaultFolder = getDefaultSketchbookFolder();
if (BaseNoGui.getPortableFolder() != null)
Preferences.set("sketchbook.path", portableSketchbookFolder);
Preferences.set("sketchbook.path", BaseNoGui.getPortableSketchbookFolder());
else
Preferences.set("sketchbook.path", defaultFolder.getAbsolutePath());
if (!defaultFolder.exists()) {
@ -1865,7 +1863,7 @@ public class Base {
static public String getPortableSketchbookFolder() {
return portableSketchbookFolder;
return BaseNoGui.getPortableSketchbookFolder();
}
@ -1891,7 +1889,7 @@ public class Base {
protected File getDefaultSketchbookFolder() {
if (BaseNoGui.getPortableFolder() != null)
return new File(BaseNoGui.getPortableFolder(), portableSketchbookFolder);
return new File(BaseNoGui.getPortableFolder(), BaseNoGui.getPortableSketchbookFolder());
File sketchbookFolder = null;
try {

View File

@ -69,6 +69,8 @@ public class BaseNoGui {
static File portableFolder = null;
static final String portableSketchbookFolder = "sketchbook";
// Returns a File object for the given pathname. If the pathname
// is not absolute, it is interpreted relative to the current
// directory when starting the IDE (which is not the same as the
@ -187,6 +189,10 @@ public class BaseNoGui {
return portableFolder;
}
static public String getPortableSketchbookFolder() {
return portableSketchbookFolder;
}
/**
* Convenience method to get a File object for the specified filename inside
* the settings folder.