@@ -143,6 +143,18 @@ static public TargetPlatform getCurrentTargetPlatformFromPackage(String pack) {
143
143
return getTargetPlatform (pack , PreferencesData .get ("target_platform" ));
144
144
}
145
145
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
+
146
158
public static DiscoveryManager getDiscoveryManager () {
147
159
return discoveryManager ;
148
160
}
@@ -262,14 +274,14 @@ static public File getSketchbookLibrariesFolder() {
262
274
263
275
static public String getSketchbookPath () {
264
276
// 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" );
266
278
267
279
// If a value is at least set, first check to see if the folder exists.
268
280
// If it doesn't, warn the user that the sketchbook folder is being reset.
269
281
if (sketchbookPath != null ) {
270
282
File sketchbookFolder ;
271
- if (BaseNoGui . getPortableFolder () != null )
272
- sketchbookFolder = new File (BaseNoGui . getPortableFolder (), sketchbookPath );
283
+ if (getPortableFolder () != null )
284
+ sketchbookFolder = new File (getPortableFolder (), sketchbookPath );
273
285
else
274
286
sketchbookFolder = absoluteFile (sketchbookPath );
275
287
if (!sketchbookFolder .exists ()) {
0 commit comments