diff --git a/source/net/sourceforge/filebot/ui/rename/FilesListTransferablePolicy.java b/source/net/sourceforge/filebot/ui/rename/FilesListTransferablePolicy.java index 5fa3a89c..852ed2f7 100644 --- a/source/net/sourceforge/filebot/ui/rename/FilesListTransferablePolicy.java +++ b/source/net/sourceforge/filebot/ui/rename/FilesListTransferablePolicy.java @@ -3,7 +3,9 @@ package net.sourceforge.filebot.ui.rename; import static java.util.Arrays.*; +import static net.sourceforge.filebot.ui.transfer.FileTransferable.*; +import java.awt.datatransfer.Transferable; import java.io.File; import java.util.ArrayList; import java.util.LinkedList; @@ -36,8 +38,26 @@ class FilesListTransferablePolicy extends FileTransferablePolicy { } + @Override + public void handleTransferable(Transferable tr, TransferAction action) throws Exception { + if (action == TransferAction.LINK) { + // special handling for do-not-resolve-folders-drop + clear(); + load(getFilesFromTransferable(tr), false); + } else { + // load files recursively by default + super.handleTransferable(tr, action); + } + } + + @Override protected void load(List files) { + load(files, true); + } + + + protected void load(List files, boolean recursive) { List entries = new ArrayList(); LinkedList queue = new LinkedList(files); @@ -47,7 +67,7 @@ class FilesListTransferablePolicy extends FileTransferablePolicy { if (f.isHidden()) continue; - if (f.isFile() || MediaDetection.isDiskFolder(f)) { + if (!recursive || f.isFile() || MediaDetection.isDiskFolder(f)) { entries.add(f); } else { queue.addAll(0, asList(f.listFiles()));