mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-14 11:29:26 +01:00
Removed unused code, fixed indentation.
This commit is contained in:
parent
57bee97d7b
commit
3a72c02480
@ -1212,34 +1212,17 @@ public class Base {
|
|||||||
|
|
||||||
for (String potentialName : list) {
|
for (String potentialName : list) {
|
||||||
File libFolder = new File(folder, potentialName);
|
File libFolder = new File(folder, potentialName);
|
||||||
// File libraryFolder = new File(subfolder, "library");
|
String sanityCheck = Sketch.sanitizeName(potentialName);
|
||||||
// File libraryJar = new File(libraryFolder, potentialName + ".jar");
|
if (!sanityCheck.equals(potentialName)) {
|
||||||
// // If a .jar file of the same prefix as the folder exists
|
String mess = I18n.format(_("The library \"{0}\" cannot be used.\n"
|
||||||
// // inside the 'library' subfolder of the sketch
|
+ "Library names must contain only basic letters and numbers.\n"
|
||||||
// if (libraryJar.exists()) {
|
+ "(ASCII only and no spaces, and it cannot start with a number)"),
|
||||||
String sanityCheck = Sketch.sanitizeName(potentialName);
|
potentialName);
|
||||||
if (!sanityCheck.equals(potentialName)) {
|
Base.showMessage(_("Ignoring bad library name"), mess);
|
||||||
String mess = I18n.format(
|
continue;
|
||||||
_("The library \"{0}\" cannot be used.\n" +
|
}
|
||||||
"Library names must contain only basic letters and numbers.\n" +
|
|
||||||
"(ASCII only and no spaces, and it cannot start with a number)"),
|
|
||||||
potentialName
|
|
||||||
);
|
|
||||||
Base.showMessage(_("Ignoring bad library name"), mess);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
String libraryName = potentialName;
|
String libraryName = potentialName;
|
||||||
// // get the path for all .jar files in this code folder
|
|
||||||
// String libraryClassPath =
|
|
||||||
// Compiler.contentsToClassPath(libraryFolder);
|
|
||||||
// // grab all jars and classes from this folder,
|
|
||||||
// // and append them to the library classpath
|
|
||||||
// librariesClassPath +=
|
|
||||||
// File.pathSeparatorChar + libraryClassPath;
|
|
||||||
// // need to associate each import with a library folder
|
|
||||||
// String packages[] =
|
|
||||||
// Compiler.packageListFromClassPath(libraryClassPath);
|
|
||||||
libraries.add(libFolder);
|
libraries.add(libFolder);
|
||||||
String libFolderPath = libFolder.getAbsolutePath();
|
String libFolderPath = libFolder.getAbsolutePath();
|
||||||
try {
|
try {
|
||||||
@ -1268,22 +1251,11 @@ public class Base {
|
|||||||
"Unable to list header files in {0}", libFolder), e);
|
"Unable to list header files in {0}", libFolder), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
JMenuItem item = new JMenuItem(libraryName);
|
JMenuItem item = new JMenuItem(libraryName);
|
||||||
item.addActionListener(listener);
|
item.addActionListener(listener);
|
||||||
item.setActionCommand(libFolderPath);
|
item.setActionCommand(libFolderPath);
|
||||||
menu.add(item);
|
menu.add(item);
|
||||||
ifound = true;
|
ifound = true;
|
||||||
|
|
||||||
// XXX: DAM: should recurse here so that library folders can be nested
|
|
||||||
// } else { // not a library, but is still a folder, so recurse
|
|
||||||
// JMenu submenu = new JMenu(libraryName);
|
|
||||||
// // needs to be separate var, otherwise would set ifound to false
|
|
||||||
// boolean found = addLibraries(submenu, subfolder);
|
|
||||||
// if (found) {
|
|
||||||
// menu.add(submenu);
|
|
||||||
// ifound = true;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
return ifound;
|
return ifound;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user