a little more cleanup

This commit is contained in:
Ben Fry
2020-08-16 11:06:40 -04:00
parent 333b0827cf
commit 1c86f3e215
2 changed files with 11 additions and 15 deletions
@@ -638,7 +638,7 @@ public class ContributionManager {
/**
* Updates all the flagged modes/tools.
* Updates all the flagged Mode and Tool folders.
*/
static private void updateFlagged(Base base, File root) throws Exception {
// https://github.com/processing/processing/issues/6034
@@ -659,8 +659,7 @@ public class ContributionManager {
List<AvailableContribution> updateContribsList = new LinkedList<>();
// TODO This is bad code... This root.getName() stuff to get the folder
// type, plus "libraries.properties" (not the correct file name),
// and I have no idea what "putting this here, in just in case" means.
// type, plus "libraries.properties" (not the correct file name).
// Not sure the function here so I'm not fixing it at the moment,
// but this whole function could use some cleaning. [fry 180105]
@@ -671,8 +670,6 @@ public class ContributionManager {
propFileName = "tool.properties";
else if (type.equalsIgnoreCase("modes"))
propFileName = "mode.properties";
else if (type.equalsIgnoreCase("libraries")) //putting this here, just in case
propFileName = "libraries.properties";
for (File folder : markedForUpdate) {
StringDict props = Util.readSettings(new File(folder, propFileName));
@@ -680,19 +677,15 @@ public class ContributionManager {
Util.removeDir(folder);
}
Iterator<AvailableContribution> iter = listing.advertisedContributions.iterator();
while (iter.hasNext()) {
AvailableContribution availableContribs = iter.next();
if (updateContribsNames.contains(availableContribs.getName())) {
updateContribsList.add(availableContribs);
for (AvailableContribution contrib : listing.advertisedContributions) {
if (updateContribsNames.contains(contrib.getName())) {
updateContribsList.add(contrib);
}
}
Iterator<AvailableContribution> iter2 = updateContribsList.iterator();
while (iter2.hasNext()) {
AvailableContribution contribToUpdate = iter2.next();
installOnStartUp(base, contribToUpdate);
listing.replaceContribution(contribToUpdate, contribToUpdate);
for (AvailableContribution contrib : updateContribsList) {
installOnStartUp(base, contrib);
listing.replaceContribution(contrib, contrib);
}
}
+3
View File
@@ -6,6 +6,9 @@ X https://github.com/processing/processing4/issues/83
X bump JDK to 11.0.8
X Make macOS notarization part of the build process
X https://github.com/processing/processing4/issues/24
X NullPointerException in ContributionManager.updateFlagged() on startup
X check for directory existence and read/write access on startup
X https://github.com/processing/processing/issues/6034
sam
X Resolve rewrite of pixelDensity to settings in preproc