X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2FInstance.java;h=96d5d6f9a3031124cce38f8d59f81ea53138df2e;hb=6a211e41dfcf8f187caf29a307fc9ae983ad4d57;hp=84a583e6635d8ec966c7fb8cf1ef334ecaa0bb9a;hpb=ee9b7083501b94c9ff00ab1d7e481d6f8dec8b05;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/Instance.java b/src/be/nikiroo/fanfix/Instance.java index 84a583e..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#getDirectory()} - * 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; }