@@ -143,6 +143,18 @@ static public TargetPlatform getCurrentTargetPlatformFromPackage(String pack) {
143143 return getTargetPlatform (pack , PreferencesData .get ("target_platform" ));
144144 }
145145
146+ static public File getDefaultSketchbookFolder () {
147+ if (getPortableFolder () != null )
148+ return new File (getPortableFolder (), getPortableSketchbookFolder ());
149+
150+ File sketchbookFolder = null ;
151+ try {
152+ sketchbookFolder = getPlatform ().getDefaultSketchbookFolder ();
153+ } catch (Exception e ) { }
154+
155+ return sketchbookFolder ;
156+ }
157+
146158 public static DiscoveryManager getDiscoveryManager () {
147159 return discoveryManager ;
148160 }
@@ -262,14 +274,14 @@ static public File getSketchbookLibrariesFolder() {
262274
263275 static public String getSketchbookPath () {
264276 // Get the sketchbook path, and make sure it's set properly
265- String sketchbookPath = Preferences .get ("sketchbook.path" );
277+ String sketchbookPath = PreferencesData .get ("sketchbook.path" );
266278
267279 // If a value is at least set, first check to see if the folder exists.
268280 // If it doesn't, warn the user that the sketchbook folder is being reset.
269281 if (sketchbookPath != null ) {
270282 File sketchbookFolder ;
271- if (BaseNoGui . getPortableFolder () != null )
272- sketchbookFolder = new File (BaseNoGui . getPortableFolder (), sketchbookPath );
283+ if (getPortableFolder () != null )
284+ sketchbookFolder = new File (getPortableFolder (), sketchbookPath );
273285 else
274286 sketchbookFolder = absoluteFile (sketchbookPath );
275287 if (!sketchbookFolder .exists ()) {
0 commit comments