From 9053df63162f7956f1101b9b46771805993b07ec Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Fri, 15 Feb 2008 20:02:23 +0000 Subject: [PATCH] * complete dnd support for ubuntu :D --- .../sourceforge/filebot/ui/transfer/FileTransferable.java | 2 +- .../ui/transferablepolicies/FileTransferablePolicy.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/source/net/sourceforge/filebot/ui/transfer/FileTransferable.java b/source/net/sourceforge/filebot/ui/transfer/FileTransferable.java index e4050989..84a5d880 100644 --- a/source/net/sourceforge/filebot/ui/transfer/FileTransferable.java +++ b/source/net/sourceforge/filebot/ui/transfer/FileTransferable.java @@ -53,7 +53,7 @@ public class FileTransferable implements Transferable { StringBuffer sb = new StringBuffer(); for (File file : files) { - sb.append(file.toURI()); + sb.append("file:///" + file.toURI().getPath()); sb.append("\r\n"); } diff --git a/source/net/sourceforge/filebot/ui/transferablepolicies/FileTransferablePolicy.java b/source/net/sourceforge/filebot/ui/transferablepolicies/FileTransferablePolicy.java index 4b992ae3..5345adae 100644 --- a/source/net/sourceforge/filebot/ui/transferablepolicies/FileTransferablePolicy.java +++ b/source/net/sourceforge/filebot/ui/transferablepolicies/FileTransferablePolicy.java @@ -39,7 +39,7 @@ public abstract class FileTransferablePolicy extends TransferablePolicy { if (tr.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { return (List) tr.getTransferData(DataFlavor.javaFileListFlavor); } else if (tr.isDataFlavorSupported(FileBotUtil.uriListFlavor)) { - String transferString = (String) tr.getTransferData(DataFlavor.stringFlavor); + String transferString = (String) tr.getTransferData(FileBotUtil.uriListFlavor); String lines[] = transferString.split("\r?\n"); ArrayList files = new ArrayList(lines.length); @@ -57,9 +57,11 @@ public abstract class FileTransferablePolicy extends TransferablePolicy { files.add(file); } catch (Exception e) { // URISyntaxException, IllegalArgumentException - Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).log(Level.WARNING, "Invalid file url: " + line, e); + Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).log(Level.WARNING, "Invalid file url: " + line); } } + + return files; } } catch (UnsupportedFlavorException e) { e.printStackTrace();