[vlma-devel] commit: Load the user configuration file first. (Adrien Grand )
git version control
git at videolan.org
Sat May 3 12:42:01 CEST 2008
vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Sat May 3 12:43:11 2008 +0200| [af2545136eb7835af55239a98f548b468a970c54]
Load the user configuration file first.
> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=af2545136eb7835af55239a98f548b468a970c54
---
.../main/java/org/videolan/vlma/common/VLMa.java | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/core/src/main/java/org/videolan/vlma/common/VLMa.java b/core/src/main/java/org/videolan/vlma/common/VLMa.java
index 87f24d4..eb678cc 100644
--- a/core/src/main/java/org/videolan/vlma/common/VLMa.java
+++ b/core/src/main/java/org/videolan/vlma/common/VLMa.java
@@ -94,8 +94,8 @@ public class VLMa extends CompositeConfiguration implements Configuration {
}
private VLMa(File f) throws ConfigurationException {
- super(new PropertiesConfiguration(f));
- ((PropertiesConfiguration) this.getInMemoryConfiguration()).setAutoSave(true);
+ super(getUserConf(f));
+ this.addConfiguration(getUserConf(f));
}
private VLMa() {
@@ -112,6 +112,12 @@ public class VLMa extends CompositeConfiguration implements Configuration {
return userConfFile;
}
+ private static Configuration getUserConf(File f) throws ConfigurationException {
+ PropertiesConfiguration configuration = new PropertiesConfiguration(f);
+ configuration.setAutoSave(true);
+ return configuration;
+ }
+
private static File getVLMaHome() throws IOException {
File userHome = new File(System.getProperty("user.home"));
logger.debug("User home is " + userHome);
More information about the vlma-devel
mailing list