X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2FMain.java;h=f83186c1d89bffdd01b1c837a1b29b6047cb5f33;hb=350bc060516184774f8116e61696a8c3c45ba85d;hp=1e4daa801b9b852de9bb91f0964fd7d73d176864;hpb=1822d603af35b758310e182e50103f0a2bffbc85;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/Main.java b/src/be/nikiroo/fanfix/Main.java index 1e4daa8..f83186c 100644 --- a/src/be/nikiroo/fanfix/Main.java +++ b/src/be/nikiroo/fanfix/Main.java @@ -354,18 +354,12 @@ public class Main { } } - // 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)); - } + try { + Instance.getTempFiles().close(); + } catch (IOException e) { + Instance.getTraceHandler() + .error(new IOException( + "Cannot dispose of the temporary files", e)); } if (exitCode == 255) { @@ -462,7 +456,7 @@ public class Main { } /** - * Start the CLI reader for this {@link Story}. + * Start the current reader for this {@link Story}. * * @param story * the LUID of the {@link Story} in the {@link LocalLibrary} @@ -488,7 +482,7 @@ public class Main { if (chapString != null) { try { reader.setChapter(Integer.parseInt(chapString)); - reader.read(); + reader.read(true); } catch (NumberFormatException e) { Instance.getTraceHandler().error( new IOException("Chapter number cannot be parsed: " @@ -496,7 +490,7 @@ public class Main { return 2; } } else { - reader.read(); + reader.read(true); } } catch (IOException e) { Instance.getTraceHandler().error(e); @@ -527,6 +521,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); @@ -547,6 +542,8 @@ 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) {