Skip to content

Commit 2058263

Browse files
bitroncmaglie
authored andcommitted
Moved portableSketchbookFolder from Base to BaseNoGui.
1 parent 10af59f commit 2058263

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

app/src/processing/app/Base.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ public class Base {
9494
List<Editor> editors = Collections.synchronizedList(new ArrayList<Editor>());
9595
Editor activeEditor;
9696

97-
static final String portableSketchbookFolder = "sketchbook";
98-
9997
static public void main(String args[]) throws Exception {
10098
BaseNoGui.initLogger();
10199

@@ -226,7 +224,7 @@ public Base(String[] args) throws Exception {
226224
if (sketchbookPath == null) {
227225
File defaultFolder = getDefaultSketchbookFolder();
228226
if (BaseNoGui.getPortableFolder() != null)
229-
Preferences.set("sketchbook.path", portableSketchbookFolder);
227+
Preferences.set("sketchbook.path", BaseNoGui.getPortableSketchbookFolder());
230228
else
231229
Preferences.set("sketchbook.path", defaultFolder.getAbsolutePath());
232230
if (!defaultFolder.exists()) {
@@ -1865,7 +1863,7 @@ static public File getPortableFolder() {
18651863

18661864

18671865
static public String getPortableSketchbookFolder() {
1868-
return portableSketchbookFolder;
1866+
return BaseNoGui.getPortableSketchbookFolder();
18691867
}
18701868

18711869

@@ -1891,7 +1889,7 @@ static public File getSketchbookHardwareFolder() {
18911889

18921890
protected File getDefaultSketchbookFolder() {
18931891
if (BaseNoGui.getPortableFolder() != null)
1894-
return new File(BaseNoGui.getPortableFolder(), portableSketchbookFolder);
1892+
return new File(BaseNoGui.getPortableFolder(), BaseNoGui.getPortableSketchbookFolder());
18951893

18961894
File sketchbookFolder = null;
18971895
try {

app/src/processing/app/BaseNoGui.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ public class BaseNoGui {
6969

7070
static File portableFolder = null;
7171

72+
static final String portableSketchbookFolder = "sketchbook";
73+
7274
// Returns a File object for the given pathname. If the pathname
7375
// is not absolute, it is interpreted relative to the current
7476
// directory when starting the IDE (which is not the same as the
@@ -187,6 +189,10 @@ static public File getPortableFolder() {
187189
return portableFolder;
188190
}
189191

192+
static public String getPortableSketchbookFolder() {
193+
return portableSketchbookFolder;
194+
}
195+
190196
/**
191197
* Convenience method to get a File object for the specified filename inside
192198
* the settings folder.

0 commit comments

Comments
 (0)