X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2FMain.java;h=53c4a8629f952075f4519131f5541363f5701f45;hb=85493b380b07146e2b36c0ffe40d2dc17a4ebdf2;hp=42f3924daa811bdb1bb6e121d38c01b651bf828b;hpb=2aac79c740789071ad9b773d25f20e103f0da86c;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/Main.java b/src/be/nikiroo/fanfix/Main.java index 42f3924..53c4a86 100644 --- a/src/be/nikiroo/fanfix/Main.java +++ b/src/be/nikiroo/fanfix/Main.java @@ -221,6 +221,9 @@ public class Main { int diff = progress.getProgress() - current; current += diff; + if (diff <= 0) + return; + StringBuilder builder = new StringBuilder(); for (int i = 0; i < diff; i++) { builder.append('.'); @@ -351,12 +354,18 @@ public class Main { } } - try { - Instance.getTempFiles().close(); - } catch (IOException e) { - Instance.getTraceHandler() - .error(new IOException( - "Cannot dispose of the temporary files", e)); + // We cannot do it when in GUI mode, because it is async... + // So if we close the temp files before it is actually used, + // we have a problem... + // TODO: close it at the correct time (for now, finalize try to do it) + if (false) { + try { + Instance.getTempFiles().close(); + } catch (IOException e) { + Instance.getTraceHandler().error( + new IOException( + "Cannot dispose of the temporary files", e)); + } } if (exitCode == 255) { @@ -518,6 +527,7 @@ public class Main { String target, boolean infoCover, Progress pg) { int exitCode = 0; + Instance.getTraceHandler().trace("Convert: " + urlString); String sourceName = urlString; try { URL source = BasicReader.getUrl(urlString); @@ -538,6 +548,7 @@ public class Main { BasicSupport support = BasicSupport.getSupport(source); if (support != null) { + Instance.getTraceHandler().trace("Support found: " + support.getClass()); Progress pgIn = new Progress(); Progress pgOut = new Progress(); if (pg != null) {