Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removed useless showEditor parameter from Base.handleOpen
Previously it was used to prevent the Editor from being displayed
when running in command-line mode. Now the Editor is not created at
all, so this parameter is useless.

This is also confirmed by the remaining calls to `handleOpen` that
all have the parameter set to `true`.
  • Loading branch information
cmaglie committed Nov 25, 2016
commit 3d52de7191a3d97723c71277014766f36147fc6e
19 changes: 8 additions & 11 deletions app/src/processing/app/Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,9 @@ public Base(String[] args) throws Exception {
}
}

boolean showEditor = parser.isGuiMode();
if (!parser.isForceSavePrefs())
PreferencesData.setDoSave(showEditor);
if (handleOpen(file, retrieveSketchLocation(".default"), showEditor, false) == null) {
PreferencesData.setDoSave(true);
if (handleOpen(file, retrieveSketchLocation(".default"), false) == null) {
String mess = I18n.format(tr("Failed to open sketch: \"{0}\""), path);
// Open failure is fatal in upload/verify mode
if (parser.isVerifyOrUploadMode())
Expand Down Expand Up @@ -502,7 +501,7 @@ protected boolean restoreSketches() throws Exception {
}
int[] location = retrieveSketchLocation("" + i);
// If file did not exist, null will be returned for the Editor
if (handleOpen(new File(path), location, nextEditorLocation(), true, false, false) != null) {
if (handleOpen(new File(path), location, nextEditorLocation(), false, false) != null) {
opened++;
}
}
Expand Down Expand Up @@ -794,14 +793,14 @@ public Editor handleOpen(File file) throws Exception {
}

public Editor handleOpen(File file, boolean untitled) throws Exception {
return handleOpen(file, nextEditorLocation(), true, untitled);
return handleOpen(file, nextEditorLocation(), untitled);
}

protected Editor handleOpen(File file, int[] location, boolean showEditor, boolean untitled) throws Exception {
return handleOpen(file, location, location, showEditor, true, untitled);
protected Editor handleOpen(File file, int[] location, boolean untitled) throws Exception {
return handleOpen(file, location, location, true, untitled);
}

protected Editor handleOpen(File file, int[] storedLocation, int[] defaultLocation, boolean showEditor, boolean storeOpenedSketches, boolean untitled) throws Exception {
protected Editor handleOpen(File file, int[] storedLocation, int[] defaultLocation, boolean storeOpenedSketches, boolean untitled) throws Exception {
if (!file.exists()) return null;

// Cycle through open windows to make sure that it's not already open.
Expand Down Expand Up @@ -834,9 +833,7 @@ protected Editor handleOpen(File file, int[] storedLocation, int[] defaultLocati

// now that we're ready, show the window
// (don't do earlier, cuz we might move it based on a window being closed)
if (showEditor) {
SwingUtilities.invokeLater(() -> editor.setVisible(true));
}
SwingUtilities.invokeLater(() -> editor.setVisible(true));

return editor;
}
Expand Down