Skip to content

Commit 24556e7

Browse files
committed
Deprioritize deprecated contributions
1 parent cecc61c commit 24556e7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

app/src/cc/arduino/contributions/packages/ui/ContributionIndexTableModel.java

+13
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import processing.app.BaseNoGui;
3737

3838
import java.util.ArrayList;
39+
import java.util.Collections;
3940
import java.util.List;
4041
import java.util.function.Predicate;
4142
import java.util.stream.Collectors;
@@ -73,6 +74,18 @@ private void updateContributions() {
7374
addContribution(platform);
7475
}
7576
}
77+
Collections.sort(contributions, (x,y)-> {
78+
if (x.isDeprecated() != y.isDeprecated()) {
79+
return x.isDeprecated() ? 1 : -1;
80+
}
81+
ContributedPlatform x1 = x.getLatest();
82+
ContributedPlatform y1 = y.getLatest();
83+
int category = (x1.getCategory().equals("Arduino") ? -1 : 0) + (y1.getCategory().equals("Arduino") ? 1 : 0);
84+
if (category != 0) {
85+
return category;
86+
}
87+
return x1.getName().compareToIgnoreCase(y1.getName());
88+
});
7689
fireTableDataChanged();
7790
}
7891

0 commit comments

Comments
 (0)