Community
Participate
Working Groups
N20100511-2000. When copying an IFile from one to another folder in the Navigator or Project Explorer, I always get the dialog no matter how I've set the preferences on the 'Linked Resources' page (even if I disable linked resources).
This is still the case in 3.7 M6.
Hi, can you be more specific please? I'm trying to reproduce the issue with 3.7m6 and 3.6.2 without success. I tried the following: Having a project with two folders: p1/ folder1/ folder2/ I have file.txt under folder1/. I drag and drop file.txt while holding the <cntl> key onto folder2/ Result: it copies the file without showing any dialog I drag and drop file.txt while holding the <cntl> key onto folder2/ Result: it moves the file without showing any dialog I tried also with two different projects, on MacOS X and WIndows 7, without success.
> I'm trying to reproduce the issue with 3.7m6 and 3.6.2 without success. Maybe you used the Package Explorer instead of the Project Explorer or Navigator? It works fine in the Package Explorer.
Created attachment 191825 [details] Screenshot For me, Project Explorer works fine, but Ctrl+drag in Navigator produces the dialog.
(And if I change "Linked Resources" property to "Copy" drag-and-drop items on a folder or a project, it still shows the link dialog.)
> For me, Project Explorer works fine, but Ctrl+drag in Navigator produces the > dialog. Note for me using N20110323-2000: Ctrl+drag to copy a simple file from one folder to another in the Project Explorer gives me the dialog. Can you check again?
Note that the bug exists when copying normal files not just linked resources.
(In reply to comment #3) > > I'm trying to reproduce the issue with 3.7m6 and 3.6.2 without success. > > Maybe you used the Package Explorer instead of the Project Explorer or > Navigator? It works fine in the Package Explorer. Ah, you're right, thanks, I can reproduce it with the Project Explorer. I'l get back to you shortly on it.
(In reply to comment #6) > > For me, Project Explorer works fine, but Ctrl+drag in Navigator produces the > > dialog. > Note for me using N20110323-2000: Ctrl+drag to copy a simple file from one > folder to another in the Project Explorer gives me the dialog. Can you check > again? Yes, using N20110323-2000 no dialog for me in Project Explorer; and I get the dialog in Navigator. Same using I20110310-1119. This is Windows 7 using 64bit stack. The behavior does not seem to change when I set "Linked Resources" property to "Copy". Even if I uncheck "Enable linked resources" the dialog still appears in Navigator.
Created attachment 191881 [details] Patch, with no API change Considering the current state of 3.7, the current fix does not require API change.
to explain what the changes are (since the diff is confusing), the previous code was {display dialog and do copy} And the new code: IPreferenceStore store= IDEWorkbenchPlugin.getDefault().getPreferenceStore(); String dndPreference= store.getString(target.isVirtual() ? IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_VIRTUAL_FOLDER_MODE : IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE); if (dndPreference.equals(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE_PROMPT)) { {display dialog and do copy} } else operation.copyResources(sources, target);
Szymon and Daniel, could you review this fix please? thanks,
The patch works and looks good. The only thing we might consider for 3.8 is whether we remove the code duplication and add a helper to CopyFilesAndFoldersOperation similar to copyOrLinkFiles(String[], IContainer, int). BTW: you don't need PMC +1 since there's no API change involved.
Serge, please update the copyright date in both files when committing to HEAD.
Thanks. this is now committed on head, along with copyright date updates.