From 8b73ca9d40e92913b896793662cd2d6b446a7860 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 19 Mar 2016 20:44:12 +0000 Subject: [PATCH] Refactor --- source/net/filebot/Main.java | 12 ++++++------ source/net/filebot/mac/MacAppUtilities.java | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/net/filebot/Main.java b/source/net/filebot/Main.java index 4a2e9284..d71d7543 100644 --- a/source/net/filebot/Main.java +++ b/source/net/filebot/Main.java @@ -188,12 +188,6 @@ public class Main { } } - // handle file arguments - List files = args.getFiles(false); - if (files.size() > 0) { - eventBus.post(new FileTransferable(files)); - } - try { // restore previous size and location restoreWindowBounds(frame, Settings.forPackage(MainFrame.class)); @@ -246,6 +240,12 @@ public class Main { frame.setIconImages(ResourceManager.getApplicationIcons()); } + // handle file arguments + List files = args.getFiles(false); + if (files.size() > 0) { + eventBus.post(new FileTransferable(files)); + } + // start application frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.setVisible(true); diff --git a/source/net/filebot/mac/MacAppUtilities.java b/source/net/filebot/mac/MacAppUtilities.java index d7f4fff4..ad321344 100644 --- a/source/net/filebot/mac/MacAppUtilities.java +++ b/source/net/filebot/mac/MacAppUtilities.java @@ -142,7 +142,7 @@ public class MacAppUtilities { Application.getApplication().setOpenFileHandler(evt -> { List files = evt.getFiles(); if (files.size() > 0) { - SwingUtilities.invokeLater(() -> handler.accept(evt.getFiles())); + SwingUtilities.invokeLater(() -> handler.accept(files)); } }); } catch (Throwable t) {