* fix potential DnD issues
This commit is contained in:
parent
c0a59b3356
commit
bab1dd2de5
|
@ -91,7 +91,12 @@ public class FileTransferable implements Transferable {
|
||||||
public static List<File> getFilesFromTransferable(Transferable tr) throws IOException, UnsupportedFlavorException {
|
public static List<File> getFilesFromTransferable(Transferable tr) throws IOException, UnsupportedFlavorException {
|
||||||
if (tr.isDataFlavorSupported(DataFlavor.javaFileListFlavor) && !useGVFS()) {
|
if (tr.isDataFlavorSupported(DataFlavor.javaFileListFlavor) && !useGVFS()) {
|
||||||
// file list flavor
|
// file list flavor
|
||||||
return sortByUniquePath((List<File>) tr.getTransferData(DataFlavor.javaFileListFlavor)); // FORCE NATURAL FILE ORDER
|
Object transferable = tr.getTransferData(DataFlavor.javaFileListFlavor);
|
||||||
|
if (transferable instanceof List) {
|
||||||
|
return sortByUniquePath((List<File>) transferable); // FORCE NATURAL FILE ORDER
|
||||||
|
} else {
|
||||||
|
return new ArrayList<File>(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tr.isDataFlavorSupported(FileTransferable.uriListFlavor)) {
|
if (tr.isDataFlavorSupported(FileTransferable.uriListFlavor)) {
|
||||||
|
|
Loading…
Reference in New Issue