Skip to content

Commit 532c68e

Browse files
committed
add foundation libraries (video/sound) to the library stats
1 parent 94b6261 commit 532c68e

3 files changed

Lines changed: 18 additions & 7 deletions

File tree

app/src/processing/app/Base.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -937,14 +937,14 @@ public void populateToolsMenu(JMenu toolsMenu) {
937937
}
938938
toolsMenu.addSeparator();
939939

940-
if (coreTools.size() > 0) {
940+
if (!coreTools.isEmpty()) {
941941
for (Tool tool : coreTools) {
942942
toolsMenu.add(createToolItem(tool));
943943
}
944944
toolsMenu.addSeparator();
945945
}
946946

947-
if (contribTools.size() > 0) {
947+
if (!contribTools.isEmpty()) {
948948
for (Tool tool : contribTools) {
949949
toolsMenu.add(createToolItem(tool));
950950
}
@@ -1032,18 +1032,23 @@ public List<ExamplesContribution> getContribExamples() {
10321032
}
10331033

10341034

1035+
/**
1036+
* Get all the contributed Modes, Libraries, Tools, and Examples
1037+
* so that they can be reported for an update check.
1038+
*/
10351039
private Set<Contribution> getInstalledContribs() {
10361040
List<ModeContribution> modeContribs = getModeContribs();
10371041
Set<Contribution> contributions = new HashSet<>(modeContribs);
10381042

10391043
for (ModeContribution modeContrib : modeContribs) {
10401044
Mode mode = modeContrib.getMode();
1041-
contributions.addAll(new ArrayList<>(mode.contribLibraries));
1045+
contributions.addAll(mode.contribLibraries);
1046+
contributions.addAll(mode.foundationLibraries);
10421047
}
10431048

1044-
// how is this different from getToolContribs()?
1045-
// TODO this duplicates code in Editor, but it's not editor-specific
1046-
contributions.addAll(ToolContribution.loadAll(getSketchbookToolsFolder()));
1049+
// For 4.1.2, not reloading all the tools here. Just in case it causes a
1050+
// regression b/c it's not clear why it was written that way. [fry 230110]
1051+
contributions.addAll(contribTools);
10471052

10481053
contributions.addAll(getContribExamples());
10491054
return contributions;

app/src/processing/app/Mode.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public abstract class Mode {
7373

7474
public List<Library> coreLibraries;
7575
public List<Library> contribLibraries;
76+
public List<Library> foundationLibraries;
7677

7778
/** Library folder for core. (Used for OpenGL in particular.) */
7879
protected Library coreLibrary;
@@ -320,7 +321,7 @@ public void rebuildLibraryList() {
320321

321322
// Check to see if video and sound are installed and move them
322323
// from the contributed list to the core list.
323-
List<Library> foundationLibraries = new ArrayList<>();
324+
foundationLibraries = new ArrayList<>();
324325
for (Library lib : contribLibraries) {
325326
if (lib.isFoundation()) {
326327
foundationLibraries.add(lib);

todo.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
1290 (4.1.2?)
2+
X add foundation libraries to the stats (https://download.processing.org/stats/)
3+
X make foundationLibraries a class var, and then access it when calling download()
4+
X also removed the "new ArrayList()" wrapping in getInstalledContribs()
5+
X seemed extraneous, perhaps dates to that being an array instead of a List?
26

37
contrib
48
X “Cannot find a class or type named ‘PApplet’” error
@@ -9,6 +13,7 @@ X https://github.com/processing/processing4/issues/619
913
X https://github.com/processing/processing4/pull/622
1014

1115

16+
1217
_ make ctrl-g work inside the find window
1318

1419
_ export to IntelliJ? how tricky?

0 commit comments

Comments
 (0)