Restore original order when using Autodetect matcher

This commit is contained in:
Reinhard Pointner 2016-04-10 08:11:15 +00:00
parent e22c35bfe3
commit 21d643c544
2 changed files with 4 additions and 4 deletions

View File

@ -83,7 +83,6 @@ public class SelectDialog<T> extends JDialog {
// add repeat button // add repeat button
if (autoRepeatEnabled) { if (autoRepeatEnabled) {
autoRepeatCheckBox.setSelected(autoRepeatSelected); autoRepeatCheckBox.setSelected(autoRepeatSelected);
autoRepeatCheckBox.setToolTipText("Remember");
autoRepeatCheckBox.setCursor(getPredefinedCursor(HAND_CURSOR)); autoRepeatCheckBox.setCursor(getPredefinedCursor(HAND_CURSOR));
autoRepeatCheckBox.setIcon(ResourceManager.getIcon("button.repeat")); autoRepeatCheckBox.setIcon(ResourceManager.getIcon("button.repeat"));
autoRepeatCheckBox.setSelectedIcon(ResourceManager.getIcon("button.repeat.selected")); autoRepeatCheckBox.setSelectedIcon(ResourceManager.getIcon("button.repeat.selected"));

View File

@ -2,6 +2,7 @@
package net.filebot.ui.rename; package net.filebot.ui.rename;
import static java.util.Collections.*; import static java.util.Collections.*;
import static java.util.Comparator.*;
import static java.util.stream.Collectors.*; import static java.util.stream.Collectors.*;
import static net.filebot.Logging.*; import static net.filebot.Logging.*;
import static net.filebot.Settings.*; import static net.filebot.Settings.*;
@ -50,10 +51,10 @@ class AutoDetectMatcher implements AutoCompleteMatcher {
try { try {
return it.getValue().get().stream(); return it.getValue().get().stream();
} catch (Exception e) { } catch (Exception e) {
log.log(Level.WARNING, "Failed to process group: " + it.getKey(), e); log.log(Level.WARNING, "Failed group: " + it.getKey(), e);
return Stream.empty();
} }
return Stream.empty(); }).sorted(comparing(Match::getValue, new OriginalOrder<File>(files))).collect(toList());
}).collect(toList());
} finally { } finally {
workerThreadPool.shutdownNow(); workerThreadPool.shutdownNow();
} }