From 301791d3fc0f152942b542e3d98ebddc0af528f2 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Mon, 13 Feb 2017 00:32:55 +0100 Subject: [PATCH] Fixes, new version number: 0.9.2 Some problems related to the Bundles and .properties files were fixed --- README.md | 10 +++---- VERSION | 2 +- ...es.jar => nikiroo-utils-0.9.5-sources.jar} | Bin 33252 -> 34033 bytes src/be/nikiroo/fanfix/Instance.java | 2 ++ src/be/nikiroo/fanfix/Library.java | 22 +++++++++++++- src/be/nikiroo/fanfix/data/MetaData.java | 27 +++++++++++++++++- 6 files changed, 55 insertions(+), 8 deletions(-) rename libs/{nikiroo-utils-0.9.4-sources.jar => nikiroo-utils-0.9.5-sources.jar} (83%) diff --git a/README.md b/README.md index 37865b7..92f5929 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,9 @@ We support a few file types for local story conversion (both as input and as out ## Supported platforms -Any platform with at lest Java 1.5 on it should be ok. +Any platform with at lest Java 1.6 on it should be ok. -If you have any problems to compile it with a supported Java version (1.4 won't work, but you may try to cross-compile; 1.8 had been tested and works), please contact me. +If you have any problems to compile it with a supported Java version (1.5 won't work, but you may try to cross-compile or change the Bundle.java class from the utilities; 1.6 and 1.8 have been tested and work), please contact me. ## Usage @@ -71,10 +71,10 @@ You can also import the java sources into, say, [Eclipse](https://eclipse.org/), ### Dependant libraries (included) -- libs/nikiroo-utils-sources-0.9.2.jar: some shared utility functions I also use elsewhere -- [libs/unbescape-1.1.4-sources.jar](https://github.com/unbescape/unbescape): a nice library to escape/unescape a lot of text formats; I only use it for HTML +- libs/nikiroo-utils-sources.jar: some shared utility functions I also use elsewhere +- [libs/unbescape-sources.jar](https://github.com/unbescape/unbescape): a nice library to escape/unescape a lot of text formats; I only use it for HTML -Nothing else but Java 1.5+. +Nothing else but Java 1.6+. Note that calling ```make libs``` will export the libraries into the src/ directory. diff --git a/VERSION b/VERSION index f374f66..2003b63 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.1 +0.9.2 diff --git a/libs/nikiroo-utils-0.9.4-sources.jar b/libs/nikiroo-utils-0.9.5-sources.jar similarity index 83% rename from libs/nikiroo-utils-0.9.4-sources.jar rename to libs/nikiroo-utils-0.9.5-sources.jar index 49bee8e49348622c1ebfd66a51bc8126784f5fe7..7e424791ebb8637014546b728cc47b6f1b97eee7 100644 GIT binary patch delta 4012 zcmZ{nRan%E7R865OS-!|1*E%U0Er<60g>(@MCwmVBMd{ggutP@K`DVlOAeAsmmnYr z+~aw<_vP-F{jI(Cx7X|X?L>mlLq}Oz# z#Rn#(M%U8@{ZC1Q5J~_8pza)C|LVEDkEb8p&R*HiJ!+|y0a#n#^zY3%O0 zDop&~_84!e(7|G|^j1lON9@>?lKW6Im#Jtp(=36XM$3a%{oxLhVV%ZFfaUGB51CrK zK;`oaN(3j>tCoLLx3DuiE`v{$JZ+)a^O!ZxKsGRjUObyDwQbr3PEWynLP@<+4f|DB zLSI>h9_@44re+v}oG#r&0O_t@HqGkZv?4oW1&JGYQ`Dj6M#Vq7-i&|iUHD}_^5|=m zp4_IMDu$ThjwX>Edp)t)O@%X*Zzp_FkJMH=CZ?=QfiBjIQU-_Dr{OUKppTv9VRoPC zBA;#?RB1)K3MXv=1MVC(7tDC%bnkK`z@rwu#WC@B5%F51nobUEKRdl~!v?B_T$#Qn zFZLFxD*tlU>(g3!MX$x+bHKgXrI9bQw*buUoctoJK}wZtnFt}tnRY-)t2anPqNwf+ z)TaK6E$Ww;Jey~<6nnr^B^Gv-@319F(&KG_mQUD*bItlcJ<*18QUq5ZwHR zcUZ|~A+zH#_BL2;#dxALO%<|j}`M9c! z+R?<=2y8*17wbJtX~AWwUf=0!QENP`WZo^QH{l&a`Eu!c9??l5>nr>;dOZQ$CEzQT zmpZ|v%@nI~q~FFZnkbF#M6tDG@P-(spr!Y>6}Plfu7C|af+u2oCC77DogB6tdsI`VA=26$F&>_V)WuUX|yW9r?`kiaVu`I6^`}k45C7e)K3O? z0q(xL9SNCuhZ3O%r+BnPj@n`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mU&>z6)_}ue%I;ZgYRazk}iKQP?wBKsavMcWs;N5E6}*xV0i0cj*Gif9J&} zY&;Z!+OwplW$%mx-GwMp0pPVXFm?QR1ubHB=Tv-?OceaVjY98=TIe+G?S!^l-tq>8 zu4%3X0BFP4wn9Fzo_+b9wjbo`#`>eJG7bIk)YbzsAMLZFx`GMa;PHFDSr|^5F(8?+ zeY3waD%tT!(z>T0?DY&mGrPhif77<{^^G2sI{3Co7i2bU>G?%36^=Ozv4WFz@|qC4 zdc4XtRP;`Mi~9`6EqdnCh!v@KtefZST`u~xY`gKFIx~)X9$r9v!az^$MrkdvzPIT1 zn;x41JI-N`ilJLTAKbU(&_oV+jXQC=hF~v)I7#7O3vkb)h_@^&yvXX4e|%*ZKTflO ztTW^tN3yw}f)^w1Sl<0xE9_2IGLcN6Jv_s*zGe#S{sAsnTrZi9ob+*;9an7u+UmrQ zZ7yz73E^ax$F(R*d!hq(X{e5Ycr?HdB%vk}Mm)=H*q=j4y09}pl|q{2Xmh8-`4iaDO-h8-`4?tABj~lN*2#lQ@Bn zlP-cDljMOPlWT%H0>@R8k%1kPR#_1&P)h*<6aW+e2nYxOwP8$3=aeTm;tK!(pez6Y zCIA2c0000000000002Q(lL3QL0(WDRk%1kPa)UDhjb)ROfgO`;XdRQ`gDL`@X_JwG t6O$l>I|4;&laYZFlW>Ga0)lLlk%1GF%Y+yX5daYY5(NMNynFxv001HPD?$JO diff --git a/src/be/nikiroo/fanfix/Instance.java b/src/be/nikiroo/fanfix/Instance.java index 9c20682..91902c3 100644 --- a/src/be/nikiroo/fanfix/Instance.java +++ b/src/be/nikiroo/fanfix/Instance.java @@ -47,7 +47,9 @@ public class Instance { } try { trans = new StringIdBundle(getLang()); + System.out.println("UPDATING"); trans.updateFile(configDir); + System.out.println("UPDATED"); } catch (IOException e) { syserr(e); } diff --git a/src/be/nikiroo/fanfix/Library.java b/src/be/nikiroo/fanfix/Library.java index 304f19f..abe760b 100644 --- a/src/be/nikiroo/fanfix/Library.java +++ b/src/be/nikiroo/fanfix/Library.java @@ -75,6 +75,26 @@ public class Library { return list; } + /** + * Retrieve a {@link File} corresponding to the given {@link Story}. + * + * @param luid + * the Library UID of the story + * + * @return the corresponding {@link Story} + */ + public MetaData getInfo(String luid) { + if (luid != null) { + for (Entry entry : getStories().entrySet()) { + if (luid.equals(entry.getKey().getLuid())) { + return entry.getKey(); + } + } + } + + return null; + } + /** * Retrieve a {@link File} corresponding to the given {@link Story}. * @@ -207,7 +227,7 @@ public class Library { * in case of I/O error */ private Story save(Story story, String luid) throws IOException { - MetaData key = story.getMeta(); + MetaData key = story.getMeta().clone(); if (luid == null || luid.isEmpty()) { getStories(); // refresh lastId if needed diff --git a/src/be/nikiroo/fanfix/data/MetaData.java b/src/be/nikiroo/fanfix/data/MetaData.java index 5ec9801..55c18de 100644 --- a/src/be/nikiroo/fanfix/data/MetaData.java +++ b/src/be/nikiroo/fanfix/data/MetaData.java @@ -1,6 +1,7 @@ package be.nikiroo.fanfix.data; import java.awt.image.BufferedImage; +import java.util.ArrayList; import java.util.List; /** @@ -8,7 +9,7 @@ import java.util.List; * * @author niki */ -public class MetaData { +public class MetaData implements Cloneable { private String title; private String author; private String date; @@ -313,4 +314,28 @@ public class MetaData { public void setImageDocument(boolean imageDocument) { this.imageDocument = imageDocument; } + + @Override + public MetaData clone() { + MetaData meta = null; + try { + meta = (MetaData) super.clone(); + } catch (CloneNotSupportedException e) { + // Did the clones rebel? + System.err.println(e); + } + + if (tags != null) { + meta.tags = new ArrayList(); + meta.tags.addAll(tags); + } + if (resume != null) { + meta.resume = new Chapter(resume.getNumber(), resume.getName()); + for (Paragraph para : resume) { + meta.resume.getParagraphs().add(para); + } + } + + return meta; + } } -- 2.27.0