File tree 2 files changed +11
-6
lines changed
cc/arduino/contributions/libraries
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ public class LibrariesIndexer {
60
60
private LibrariesIndex index ;
61
61
private final LibraryList installedLibraries = new LibraryList ();
62
62
private final LibraryList installedLibrariesWithDuplicates = new LibraryList ();
63
- private List <File > librariesFolders ;
63
+ private ArrayList <File > librariesFolders ;
64
64
private final File indexFile ;
65
65
private final File stagingFolder ;
66
66
private File sketchbookLibrariesFolder ;
@@ -101,11 +101,15 @@ private void parseIndex(File file) throws IOException {
101
101
}
102
102
}
103
103
104
- public void setLibrariesFolders (List <File > _librariesFolders ) {
104
+ public void setLibrariesFolders (ArrayList <File > _librariesFolders ) {
105
105
librariesFolders = _librariesFolders ;
106
106
rescanLibraries ();
107
107
}
108
108
109
+ public ArrayList <File > getLibrariesFolders () {
110
+ return librariesFolders ;
111
+ }
112
+
109
113
public void rescanLibraries () {
110
114
// Clear all installed flags
111
115
installedLibraries .clear ();
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ public class BaseNoGui {
87
87
public static Map <String , LibraryList > importToLibraryTable ;
88
88
89
89
// XXX: Remove this field
90
- static private List <File > librariesFolders ;
90
+ static private ArrayList <File > librariesFolders ;
91
91
92
92
static UserNotifier notifier = new BasicUserNotifier ();
93
93
@@ -245,7 +245,7 @@ static public String getHardwarePath() {
245
245
return getHardwareFolder ().getAbsolutePath ();
246
246
}
247
247
248
- static public List <File > getLibrariesPath () {
248
+ static public ArrayList <File > getLibrariesPath () {
249
249
return librariesFolders ;
250
250
}
251
251
@@ -679,8 +679,9 @@ static public void onBoardOrPortChange() {
679
679
// Libraries located in the latest folders on the list can override
680
680
// other libraries with the same name.
681
681
librariesIndexer .setSketchbookLibrariesFolder (getSketchbookLibrariesFolder ());
682
- librariesIndexer .setLibrariesFolders (librariesFolders );
683
- librariesIndexer .rescanLibraries ();
682
+ if (librariesIndexer .getLibrariesFolders () == null || !librariesIndexer .getLibrariesFolders ().equals (librariesFolders )) {
683
+ librariesIndexer .setLibrariesFolders (librariesFolders );
684
+ }
684
685
685
686
populateImportToLibraryTable ();
686
687
}
You can’t perform that action at this time.
0 commit comments