Skip to content

Commit 13c3750

Browse files
committed
Revert "Moving a sketch to another folder should move all files"
This reverts commit c4f5caf.
1 parent 067d7e9 commit 13c3750

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

app/src/processing/app/Editor.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import java.awt.event.ActionListener;
3939
import java.awt.event.InputEvent;
4040
import java.awt.event.KeyEvent;
41-
import java.awt.event.KeyListener;
4241
import java.awt.event.WindowAdapter;
4342
import java.awt.event.WindowEvent;
4443
import java.awt.print.PageFormat;
@@ -91,15 +90,13 @@
9190
import cc.arduino.packages.MonitorFactory;
9291
import cc.arduino.packages.Uploader;
9392
import cc.arduino.packages.uploaders.SerialUploader;
94-
import cc.arduino.view.Event;
9593
import cc.arduino.view.GoToLineNumber;
9694
import cc.arduino.view.StubMenuListener;
9795
import cc.arduino.view.findreplace.FindReplace;
9896
import jssc.SerialPortException;
9997
import processing.app.debug.RunnerException;
10098
import processing.app.forms.PasswordAuthorizationDialog;
10199
import processing.app.helpers.DocumentTextChangeListener;
102-
import processing.app.helpers.FileUtils;
103100
import processing.app.helpers.Keys;
104101
import processing.app.helpers.OSUtils;
105102
import processing.app.helpers.PreferencesMapException;
@@ -1782,7 +1779,7 @@ protected boolean handleOpenInternal(File sketchFile) {
17821779
// copy the sketch inside
17831780
File properPdeFile = new File(properFolder, sketchFile.getName());
17841781
try {
1785-
FileUtils.copy(new File(sketchFile.getParent()), properFolder);
1782+
Base.copyFile(sketchFile, properPdeFile);
17861783
} catch (IOException e) {
17871784
Base.showWarning(tr("Error"), tr("Could not copy to a proper location."), e);
17881785
return false;

arduino-core/src/processing/app/helpers/FileUtils.java

-4
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ public static void copyFile(File source, File dest) throws IOException {
5858
public static void copy(File sourceFolder, File destFolder) throws IOException {
5959
for (File file : sourceFolder.listFiles()) {
6060
File destFile = new File(destFolder, file.getName());
61-
if ((destFolder.getPath().equals(file.getPath()))) {
62-
// Avoid recursive copy of folders
63-
continue;
64-
}
6561
if (file.isDirectory() && !SOURCE_CONTROL_FOLDERS.contains(file.getName())) {
6662
if (!destFile.exists() && !destFile.mkdir()) {
6763
throw new IOException("Unable to create folder: " + destFile);

0 commit comments

Comments
 (0)