Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid performing non trivial operations on files #7904

Conversation

facchinm
Copy link
Member

@facchinm facchinm commented Aug 20, 2018

Fixes #7843 as per @cmaglie comment.

Translations should be updated removing the second part of the information text.

RATIONALE:

  • The IDE used to ask the user if s/he wanted to move a file inside the folder with the same name (on double click, for example)
  • This approach only works for single file sketches; for anything more complicated, the file would be moved but not the whole project (causing compile failures)
  • Moving a sketch to another folder should move all files #6404 tried to fix this by moving ALL the files inside a folder with the same name (works if you downloaded a project from github as ProjectName-master)

Problem: most of the times .ino files downloads from the web are being saved in the Download folder, so the move operation copied the whole Downloads content into that folder 😳

@cmaglie suggested the IDE shouldn't be allowed to do this kind of operations; this patch removes the automatic move and requires the user to create the folder and move .ino file inside it manually

@matthijskooijman
Copy link
Collaborator

Uhm, I'm a bit confused:

@facchinm
Copy link
Member Author

Argh, I was a bit in a hurry and pasted the wrong link...
I'm also expanding the rationale, just to make explicit where and why the change should be applied.
Thanks for checking anyway 😉

facchinm added a commit to facchinm/Arduino that referenced this pull request Aug 22, 2018
Alternative to arduino#7904, tries to distinguish between

* click on a single ino file downloaded from the internet (old behaviour applies, directory is created an the file is moved in it)
* click on an ino file that for some reason is part of a project with the wrong name (eg. it was downloaded as zip from github, so the containing folder names becomes "projectName-master"). In this case if the directory is created one level above the selected file, all files are moved there and the original directory is recursively deleted)
facchinm added a commit to facchinm/Arduino that referenced this pull request Aug 22, 2018
Alternative to arduino#7904, tries to distinguish between

* click on a single ino file downloaded from the internet (old behaviour applies, directory is created an the file is moved in it)
* click on an ino file that for some reason is part of a project with the wrong name (eg. it was downloaded as zip from github, so the containing folder names becomes "projectName-master"). In this case if the directory is created one level above the selected file, all files are moved there and the original directory is recursively deleted)
@cmaglie
Copy link
Member

cmaglie commented Aug 23, 2018

Follow up on #7909

@cmaglie cmaglie closed this Aug 23, 2018
@per1234 per1234 added Component: IDE The Arduino IDE feature request A request to make an enhancement (not a bug fix) Type: Duplicate Another item already exists for this topic labels Sep 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: IDE The Arduino IDE feature request A request to make an enhancement (not a bug fix) Type: Duplicate Another item already exists for this topic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IDE hangs after opening sketch file in a mismatched folder with many/large files
5 participants