From 20582630a5e7c57cb18e3bc0e5d3e8a759ccad80 Mon Sep 17 00:00:00 2001 From: Claudio Indellicati Date: Tue, 26 Aug 2014 11:48:25 +0200 Subject: [PATCH] Moved portableSketchbookFolder from Base to BaseNoGui. --- app/src/processing/app/Base.java | 8 +++----- app/src/processing/app/BaseNoGui.java | 6 ++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 94ee44a15..17379f43c 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -94,8 +94,6 @@ public class Base { List editors = Collections.synchronizedList(new ArrayList()); 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 { diff --git a/app/src/processing/app/BaseNoGui.java b/app/src/processing/app/BaseNoGui.java index 633f253bd..0c843be00 100644 --- a/app/src/processing/app/BaseNoGui.java +++ b/app/src/processing/app/BaseNoGui.java @@ -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.