X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2FInstance.java;h=c547a2b121bdf07ae3e48ad146ad28ea07ed9c04;hb=a3c355867d757f095669cb96918a96aed2b267c7;hp=733c16cf9a6e8705e1a602ec279e2b8309d6f395;hpb=4ff0b1a910b2c72ef133ba65a1bceb4be0932c87;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/Instance.java b/src/be/nikiroo/fanfix/Instance.java index 733c16c..c547a2b 100644 --- a/src/be/nikiroo/fanfix/Instance.java +++ b/src/be/nikiroo/fanfix/Instance.java @@ -17,6 +17,7 @@ import be.nikiroo.fanfix.library.LocalLibrary; import be.nikiroo.fanfix.library.RemoteLibrary; import be.nikiroo.utils.Cache; import be.nikiroo.utils.IOUtils; +import be.nikiroo.utils.Proxy; import be.nikiroo.utils.TempFiles; import be.nikiroo.utils.TraceHandler; import be.nikiroo.utils.resources.Bundles; @@ -42,7 +43,9 @@ public class Instance { static { // Before we can configure it: - tracer = new TraceHandler(true, checkEnv("DEBUG"), checkEnv("DEBUG")); + Boolean debug = checkEnv("DEBUG"); + boolean trace = debug != null && debug; + tracer = new TraceHandler(true, trace, trace); // config dir: configDir = getConfigDir(); @@ -52,20 +55,14 @@ public class Instance { // Most of the rest is dependent upon this: createConfigs(configDir, false); - + // Proxy support - // TODO: include new nikiroo-utils version - // Proxy.use(Instance.getConfig().getString(Config.USE_PROXY)); + Proxy.use(Instance.getConfig().getString(Config.USE_PROXY)); // update tracer: - boolean debug = Instance.getConfig() - .getBoolean(Config.DEBUG_ERR, false); - boolean trace = Instance.getConfig().getBoolean(Config.DEBUG_TRACE, - false); - - if (checkEnv("DEBUG")) { - debug = true; - trace = true; + if (debug == null) { + debug = Instance.getConfig().getBoolean(Config.DEBUG_ERR, false); + trace = Instance.getConfig().getBoolean(Config.DEBUG_TRACE, false); } tracer = new TraceHandler(true, debug, trace); @@ -408,7 +405,8 @@ public class Instance { trans.deleteFile(configDir); } - if (checkEnv("NOUTF")) { + Boolean noutf = checkEnv("NOUTF"); + if (noutf != null && noutf) { trans.setUnicode(false); transGui.setUnicode(false); } @@ -571,7 +569,7 @@ public class Instance { * * @return TRUE if it is */ - private static boolean checkEnv(String key) { + private static Boolean checkEnv(String key) { String value = System.getenv(key); if (value != null) { value = value.trim().toLowerCase(); @@ -580,8 +578,10 @@ public class Instance { || "y".equals(value)) { return true; } + + return false; } - return false; + return null; } }