From 4e259732c6ca4db7279596e078ef4ed5d9e9d7d5 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Fri, 11 Mar 2022 20:57:43 -0500 Subject: [PATCH] removing unused code --- .../app/contrib/LocalContribution.java | 41 ++----------------- .../processing/app/contrib/StatusPanel.java | 4 -- todo.txt | 3 +- 3 files changed, 5 insertions(+), 43 deletions(-) diff --git a/app/src/processing/app/contrib/LocalContribution.java b/app/src/processing/app/contrib/LocalContribution.java index a08b9d20b..1e77e5dc0 100644 --- a/app/src/processing/app/contrib/LocalContribution.java +++ b/app/src/processing/app/contrib/LocalContribution.java @@ -334,7 +334,6 @@ public abstract class LocalContribution extends Contribution { } File oldFolder = getFolder(); - try { Util.copyDir(oldFolder, contribFolder); } catch (IOException e) { @@ -344,15 +343,6 @@ public abstract class LocalContribution extends Contribution { return null; } - - /* - if (!getFolder().renameTo(contribFolder)) { - status.setErrorMessage("Could not move " + getTypeName() + - " \"" + getName() + "\" to the sketchbook."); - return null; - } - */ - return getType().load(base, contribFolder); } @@ -397,10 +387,7 @@ public abstract class LocalContribution extends Contribution { final ContribProgressMonitor pm, final StatusPanel status) { // TODO: replace with SwingWorker [jv] - new Thread(() -> remove(base, - pm, - status, - ContributionListing.getInstance()), "Contribution Uninstaller").start(); + new Thread(() -> remove(base, pm, status, ContributionListing.getInstance()), "Contribution Uninstaller").start(); } @@ -411,14 +398,6 @@ public abstract class LocalContribution extends Contribution { pm.startTask("Removing", ContribProgressMonitor.UNKNOWN); boolean doBackup = Preferences.getBoolean("contribution.backup.on_remove"); -// if (getType().requiresRestart()) { -// if (!doBackup || (doBackup && backup(editor, false, status))) { -// if (setDeletionFlag(true)) { -// contribListing.replaceContribution(this, this); -// } -// } -// } else { - boolean success; if (getType() == ContributionType.MODE) { boolean isModeActive = false; ModeContribution m = (ModeContribution) this; @@ -440,20 +419,12 @@ public abstract class LocalContribution extends Contribution { } if (getType() == ContributionType.TOOL) { - /* - ToolContribution t = (ToolContribution) this; - Iterator iter = editor.getBase().getEditors().iterator(); - while (iter.hasNext()) { - Editor ed = iter.next(); - ed.clearToolMenu(); - } - t.clearClassLoader(editor.getBase()); - */ // menu will be rebuilt below with the refreshContribs() call base.clearToolMenus(); ((ToolContribution) this).clearClassLoader(); } + boolean success; if (doBackup) { success = backup(true, status); } else { @@ -466,17 +437,11 @@ public abstract class LocalContribution extends Contribution { } if (success) { - // this was just rebuilding the tool menu in one editor, which happens - // yet again down below with the call to refreshInstalled() [fry 150828] -// if (getType() == ContributionType.TOOL) { -// editor.removeTool(); -// } - try { // TODO: run this in SwingWorker done() [jv] EventQueue.invokeAndWait(() -> { Contribution advertisedVersion = - contribListing.getAvailableContribution(LocalContribution.this); + contribListing.getAvailableContribution(LocalContribution.this); if (advertisedVersion == null) { contribListing.removeContribution(LocalContribution.this); diff --git a/app/src/processing/app/contrib/StatusPanel.java b/app/src/processing/app/contrib/StatusPanel.java index 8db3448f2..1f648d602 100644 --- a/app/src/processing/app/contrib/StatusPanel.java +++ b/app/src/processing/app/contrib/StatusPanel.java @@ -82,10 +82,6 @@ class StatusPanel extends JPanel { label.setEditable(false); label.setOpaque(false); label.setContentType("text/html"); -// bodyRule = "a, body { font-family: " + buttonFont.getFamily() + "; " + -// "font-size: " + buttonFont.getSize() + "pt; color: black; text-decoration: none;}"; -// bodyRule = ""; -// bodyRule = DetailPanel.getBodyStyle(); label.addHyperlinkListener(e -> { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { if (e.getURL() != null) { diff --git a/todo.txt b/todo.txt index 2e9b6251a..75b0b8508 100755 --- a/todo.txt +++ b/todo.txt @@ -16,7 +16,8 @@ X removed weird double call of installPreviouslyFailed() X remove unused icon code from ManagerTabs X implement updateTheme() X remove the extra 2-pixel line at the top -_ currently uses prepareGraphics(), do we need to remove that? +o currently uses prepareGraphics(), do we need to remove that? +X looks like nope, that was sorted out separately _ allow update of the current Mode _ an incompatible Mode prevents the PDE from quitting after last window is closed