diff --git a/app/LibraryManager.java b/app/LibraryManager.java index 7a2d20d2d..871f7fb1b 100755 --- a/app/LibraryManager.java +++ b/app/LibraryManager.java @@ -34,7 +34,7 @@ import javax.swing.*; */ public class LibraryManager { - private File coreLibDir, userLibDir; + private File libDir; private List libraries = new ArrayList(); private Target target; @@ -44,11 +44,9 @@ public class LibraryManager { public LibraryManager() throws IOException { String userDir = System.getProperty("user.dir") + File.separator; - coreLibDir = new File( + libDir = new File( ((!Base.isMacOS()) ? "" : userDir) + "hardware" + File.separator + "libraries"); - userLibDir = - new File(Sketchbook.getSketchbookPath() + File.separator + "libraries"); target = new Target( System.getProperty("user.dir") + File.separator + "hardware" + File.separator + "cores", @@ -72,15 +70,9 @@ public class LibraryManager { } }; libraries.clear(); - File[] userLibs = userLibDir.listFiles(onlyDirs); - if (userLibs != null) { - for(int i = 0; i < userLibs.length; ++i){ - libraries.add(new Library(this, userLibs[i])); - } - } - File[] coreLibs = coreLibDir.listFiles(onlyDirs); - for(int i = 0; i < coreLibs.length; ++i){ - libraries.add(new Library(this, coreLibs[i])); + File[] libs = libDir.listFiles(onlyDirs); + for(int i = 0; i < libs.length; ++i){ + libraries.add(new Library(this, libs[i])); } } diff --git a/app/Sketch.java b/app/Sketch.java index 5d99cb3aa..2e99f5468 100644 --- a/app/Sketch.java +++ b/app/Sketch.java @@ -2238,7 +2238,6 @@ public class Sketch { public boolean isReadOnly() { String apath = folder.getAbsolutePath(); if (apath.startsWith(Sketchbook.examplesPath) || - apath.startsWith(Sketchbook.userLibrariesPath) || apath.startsWith(Sketchbook.librariesPath)) { return true; diff --git a/app/Sketchbook.java b/app/Sketchbook.java index 1eb6a2e43..4c48d3ac0 100644 --- a/app/Sketchbook.java +++ b/app/Sketchbook.java @@ -68,9 +68,6 @@ public class Sketchbook { static File librariesFolder; static String librariesPath; - - static File userLibrariesFolder; - static String userLibrariesPath; // maps imported packages to their library folder static Hashtable importToLibraryTable = new Hashtable(); @@ -134,14 +131,11 @@ public class Sketchbook { //System.out.println("resetting sketchbook path"); File sketchbookFolder = Base.getDefaultSketchbookFolder(); //System.out.println("default is " + sketchbookFolder); - sketchbookPath = sketchbookFolder.getAbsolutePath(); - Preferences.set("sketchbook.path", sketchbookPath); + Preferences.set("sketchbook.path", + sketchbookFolder.getAbsolutePath()); if (!sketchbookFolder.exists()) sketchbookFolder.mkdirs(); } - userLibrariesFolder = new File(sketchbookPath, "libraries"); - userLibrariesPath = userLibrariesFolder.getAbsolutePath(); - openMenu = new JMenu("Sketchbook"); popupMenu = new JMenu("Sketchbook"); importMenu = new JMenu("Import Library"); @@ -392,7 +386,6 @@ public class Sketchbook { if (addLibraries(importMenu, examplesFolder)) { importMenu.addSeparator(); } - addLibraries(importMenu, userLibrariesFolder); addLibraries(importMenu, librariesFolder); //System.out.println("libraries cp is now " + librariesClassPath);