X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;ds=sidebyside;f=src%2Fbe%2Fnikiroo%2Ffanfix%2FInstance.java;h=a06c975420419c00d2998214438e3356101ab397;hb=99ccbdf63b539f1f40e070f5833f2d15fcf79830;hp=4cf6e86113e46c620ae50ed87022ddc49e4f0eeb;hpb=a8209dd0972f751e59153dd80a53f3062042897a;p=nikiroo-utils.git diff --git a/src/be/nikiroo/fanfix/Instance.java b/src/be/nikiroo/fanfix/Instance.java index 4cf6e86..a06c975 100644 --- a/src/be/nikiroo/fanfix/Instance.java +++ b/src/be/nikiroo/fanfix/Instance.java @@ -6,6 +6,7 @@ import java.util.Date; import be.nikiroo.fanfix.bundles.Config; import be.nikiroo.fanfix.bundles.ConfigBundle; +import be.nikiroo.fanfix.bundles.StringId; import be.nikiroo.fanfix.bundles.StringIdBundle; import be.nikiroo.fanfix.bundles.UiConfig; import be.nikiroo.fanfix.bundles.UiConfigBundle; @@ -59,7 +60,7 @@ public class Instance { private static ConfigBundle config; private static UiConfigBundle uiconfig; private static StringIdBundle trans; - private static Cache cache; + private static DataLoader cache; private static LocalLibrary lib; private static boolean debug; private static boolean trace; @@ -104,11 +105,16 @@ public class Instance { } catch (IOException e) { syserr(e); } - try { - trans = new StringIdBundle(getLang()); - trans.updateFile(configDir); - } catch (IOException e) { - syserr(e); + + // No updateFile for this one! (we do not want the user to have custom + // translations that won't accept updates from newer versions) + trans = new StringIdBundle(getLang()); + + // Fix an old bug (we used to store custom translation files by + // default): + if (trans.getString(StringId.INPUT_DESC_CBZ) == null) { + // TODO: create the deleteFile method + // trans.deleteFile(configDir); } Bundles.setDirectory(configDir); @@ -160,7 +166,7 @@ public class Instance { int hoursLarge = config .getInteger(Config.CACHE_MAX_TIME_STABLE, -1); - cache = new Cache(tmp, ua, hours, hoursLarge); + cache = new DataLoader(tmp, ua, hours, hoursLarge); } catch (IOException e) { syserr(new IOException( "Cannot create cache (will continue without cache)", e)); @@ -186,11 +192,11 @@ public class Instance { } /** - * Get the (unique) {@link Cache} for the program. + * Get the (unique) {@link DataLoader} for the program. * - * @return the {@link Cache} + * @return the {@link DataLoader} */ - public static Cache getCache() { + public static DataLoader getCache() { return cache; }