X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2FInstance.java;fp=src%2Fbe%2Fnikiroo%2Ffanfix%2FInstance.java;h=96d5d6f9a3031124cce38f8d59f81ea53138df2e;hp=8a2ed98a702144f1ece1c135964881435fd0952f;hb=6a211e41dfcf8f187caf29a307fc9ae983ad4d57;hpb=a3550a0a2d1ee45b4853c789440a4a3226fc00c7 diff --git a/src/be/nikiroo/fanfix/Instance.java b/src/be/nikiroo/fanfix/Instance.java index 8a2ed98..96d5d6f 100644 --- a/src/be/nikiroo/fanfix/Instance.java +++ b/src/be/nikiroo/fanfix/Instance.java @@ -47,11 +47,32 @@ public class Instance { /** * Initialise the instance -- if already initialised, nothing will happen. *

- * Before calling this method, you may call {@link Bundles#setDirectory()} - * if wanted. + * Before calling this method, you may call + * {@link Bundles#setDirectory(String)} if wanted. */ static public void init() { - if (init) { + init(false); + } + + /** + * Initialise the instance -- if already initialised, nothing will happen + * unless you pass TRUE to force. + *

+ * Before calling this method, you may call + * {@link Bundles#setDirectory(String)} if wanted. + *

+ * Note: forcing the initialisation can be dangerous, so make sure to only + * make it under controlled circumstances -- for instance, at the start of + * the program, you could call {@link Instance#init()}, change some settings + * because you want to force those settings (it will also forbid users to + * change them!) and then call {@link Instance#init(boolean)} with + * force set to TRUE. + * + * @param force + * force the initialisation even if already initialised + */ + static public void init(boolean force) { + if (init && !force) { return; }