removing unused code

This commit is contained in:
Ben Fry
2022-03-11 20:57:43 -05:00
parent 68bef52227
commit 4e259732c6
3 changed files with 5 additions and 43 deletions

View File

@@ -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<Editor> 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);

View File

@@ -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) {

View File

@@ -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