X-Git-Url: https://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Foutput%2FEpub.java;h=fc2dc8c982127210c308d6a9dc70a20b667162eb;hb=878ec53820a09ab01397bfe74b3e0f3884e6f9cd;hp=b7401d3922b2c182fd2ff1840ff1182986bd54cc;hpb=d15905f9d78264562da8bbcc36622e4ea4ac4d82;p=fanfix.git
diff --git a/src/be/nikiroo/fanfix/output/Epub.java b/src/be/nikiroo/fanfix/output/Epub.java
index b7401d3..fc2dc8c 100644
--- a/src/be/nikiroo/fanfix/output/Epub.java
+++ b/src/be/nikiroo/fanfix/output/Epub.java
@@ -36,7 +36,7 @@ class Epub extends BasicOutput {
String targetNameOrig = targetName;
targetName += getDefaultExtension(false);
- tmpDir = Instance.getTempFiles().createTempDir("fanfic-reader-epub");
+ tmpDir = Instance.getInstance().getTempFiles().createTempDir("fanfic-reader-epub");
tmpDir.delete();
if (!tmpDir.mkdir()) {
@@ -137,10 +137,9 @@ class Epub extends BasicOutput {
if (story.getMeta() != null && story.getMeta().getCover() != null) {
File file = new File(images, "cover");
try {
- Instance.getCache().saveAsImage(story.getMeta().getCover(),
- file, true);
+ Instance.getInstance().getCache().saveAsImage(story.getMeta().getCover(), file, true);
} catch (Exception e) {
- Instance.getTraceHandler().error(e);
+ Instance.getInstance().getTraceHandler().error(e);
}
}
@@ -246,8 +245,7 @@ class Epub extends BasicOutput {
break;
case IMAGE:
File file = new File(images, getCurrentImageBestName(false));
- Instance.getCache().saveAsImage(para.getContentImage(), file,
- nextParaIsCover);
+ Instance.getInstance().getCache().saveAsImage(para.getContentImage(), file, nextParaIsCover);
writer.write("
");
break;
@@ -358,11 +356,10 @@ class Epub extends BasicOutput {
private void generateNcx(Chapter chap, StringBuilder builder, int navPoint) {
String name;
if (chap.getName() != null && !chap.getName().isEmpty()) {
- name = Instance.getTrans().getString(StringId.CHAPTER_NAMED,
- chap.getNumber(), chap.getName());
+ name = Instance.getInstance().getTrans().getString(StringId.CHAPTER_NAMED, chap.getNumber(),
+ chap.getName());
} else {
- name = Instance.getTrans().getString(StringId.CHAPTER_UNNAMED,
- chap.getNumber());
+ name = Instance.getInstance().getTrans().getString(StringId.CHAPTER_UNNAMED, chap.getNumber());
}
String nnn = String.format("%03d", (navPoint - 2));
@@ -440,7 +437,7 @@ class Epub extends BasicOutput {
builder.append("\n ");
if (story.getMeta() != null && story.getMeta().getCover() != null) {
- String format = Instance.getConfig()
+ String format = Instance.getInstance().getConfig()
.getString(Config.FILE_FORMAT_IMAGE_FORMAT_COVER)
.toLowerCase();
builder.append("\n - ");