From 7c5b6bf8912d9b186cf9f58e6acbfafdb8cc7a8f Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Tue, 5 May 2015 13:48:16 +0000 Subject: [PATCH] * disable crash workaround until we actually fix it --- build.xml | 8 ++++---- source/net/filebot/UserFiles.java | 33 +++++++++++++++---------------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/build.xml b/build.xml index b330622e..8d88ecaf 100644 --- a/build.xml +++ b/build.xml @@ -209,7 +209,7 @@ - + @@ -259,7 +259,7 @@ - + @@ -366,7 +366,7 @@ - + @@ -534,7 +534,7 @@ - + diff --git a/source/net/filebot/UserFiles.java b/source/net/filebot/UserFiles.java index 97fc28f0..4280c42b 100644 --- a/source/net/filebot/UserFiles.java +++ b/source/net/filebot/UserFiles.java @@ -17,7 +17,6 @@ import java.util.concurrent.Callable; import java.util.concurrent.FutureTask; import java.util.logging.Level; import java.util.logging.Logger; -import java.util.prefs.Preferences; import javax.swing.JFileChooser; @@ -201,30 +200,30 @@ public class UserFiles { COCOA { - private final String KEY_NSOPENPANEL_BROKEN = "NSOPENPANEL_BROKEN"; + // private final String KEY_NSOPENPANEL_BROKEN = "NSOPENPANEL_BROKEN"; @Override public List showLoadDialogSelectFiles(boolean folderMode, boolean multiSelection, File defaultFile, ExtensionFileFilter filter, String title, ActionEvent evt) { // directly use NSOpenPanel for via Objective-C bridge for FILES_AND_DIRECTORIES mode if (folderMode && filter != null) { // NSOpenPanel causes deadlocks on some machines - Preferences persistence = Preferences.userNodeForPackage(UserFiles.class); - if (!persistence.getBoolean(KEY_NSOPENPANEL_BROKEN, false)) { - try { - // assume that NSOpenPanel may freeze the application until it is killed, and make sure to not use NSOpenPanel on subsequent runs - persistence.putBoolean(KEY_NSOPENPANEL_BROKEN, true); - persistence.flush(); + // Preferences persistence = Preferences.userNodeForPackage(UserFiles.class); + // if (!persistence.getBoolean(KEY_NSOPENPANEL_BROKEN, false)) { + try { + // assume that NSOpenPanel may freeze the application until it is killed, and make sure to not use NSOpenPanel on subsequent runs + // persistence.putBoolean(KEY_NSOPENPANEL_BROKEN, true); + // persistence.flush(); - // call native NSOpenPanel openPanel via Objective-C bridge - return MacAppUtilities.NSOpenPanel_openPanel_runModal(title, true, true, true, filter.acceptAny() ? null : filter.extensions()); - } catch (Throwable e) { - Logger.getLogger(UserFiles.class.getName()).log(Level.WARNING, e.toString()); - } finally { - persistence.putBoolean(KEY_NSOPENPANEL_BROKEN, false); // NSOpenPanel did not freeze application - } - } else { - Logger.getLogger(UserFiles.class.getName()).log(Level.WARNING, "NSOpenPanel broken. Using AWT implementation instead."); + // call native NSOpenPanel openPanel via Objective-C bridge + return MacAppUtilities.NSOpenPanel_openPanel_runModal(title, true, true, true, filter.acceptAny() ? null : filter.extensions()); + } catch (Throwable e) { + Logger.getLogger(UserFiles.class.getName()).log(Level.WARNING, e.toString()); + } finally { + // persistence.putBoolean(KEY_NSOPENPANEL_BROKEN, false); // NSOpenPanel did not freeze application } + // } else { + // Logger.getLogger(UserFiles.class.getName()).log(Level.WARNING, "NSOpenPanel broken. Using AWT implementation instead."); + // } } // default to AWT implementation