From 58c2f8767125c79c28413412fbee6a0fefec3ae0 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 10 Aug 2014 07:34:32 +0000 Subject: [PATCH] * remember default last location as expected --- source/net/filebot/UserFiles.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/net/filebot/UserFiles.java b/source/net/filebot/UserFiles.java index 3e7f763d..df0481e1 100644 --- a/source/net/filebot/UserFiles.java +++ b/source/net/filebot/UserFiles.java @@ -42,9 +42,10 @@ public class UserFiles { } public static List showLoadDialogSelectFiles(boolean folderMode, boolean multiSelection, File defaultFile, ExtensionFileFilter filter, String title, Object parent) { - List files = defaultFileChooser.showLoadDialogSelectFiles(folderMode, multiSelection, getFileChooserDefaultFile(folderMode ? KEY_OPEN_FOLDER : KEY_OPEN_FILE, defaultFile), filter, title, parent); + String defaultFileKey = (folderMode && filter == null) ? KEY_OPEN_FOLDER : KEY_OPEN_FILE; + List files = defaultFileChooser.showLoadDialogSelectFiles(folderMode, multiSelection, getFileChooserDefaultFile(defaultFileKey, defaultFile), filter, title, parent); if (files.size() > 0) { - setFileChooserDefaultFile(folderMode ? KEY_OPEN_FOLDER : KEY_OPEN_FILE, files.get(0)); + setFileChooserDefaultFile(defaultFileKey, files.get(0)); } return files; }